ruby-packer icon indicating copy to clipboard operation
ruby-packer copied to clipboard

avoid incomplete tmpdir - configure: error: something wrong with LDFLAGS

Open senthilnayagam opened this issue 7 years ago • 5 comments

my environment sw_vers -productVersion Mac O 10.12.5

ruby -v ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]

had compiler error on LDFLAGS when I downloaded rubyc from binary release. but after seeing your answer in #5 I cloned the repository and tried again

./bin/rubyc -v 0.2.0

I am still getting error with LDFLAGS

/Users/senthilnayagam/tech/ruby-compiler/bin/rubyc 
Ruby Compiler (nodec) v0.2.0
- entrance: not provided, a single Ruby interpreter executable will be produced.
- HINT: call rubyc with --help to see more options and use case examples
- options: {:make_args=>"-j4", :output=>"/Users/senthilnayagam/tech/hello/a.out", :tmpdir=>"/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc"}

-> mkdir -p /var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc
-> cd /var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/ruby
-> Running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "CFLAGS"=>" -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/zlib  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/openssl/include  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/gdbm/build/include  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/yaml/build/include  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/libffi/build/lib/libffi-3.2.1/include  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/ncurses/build/include  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/readline/build/include ", "LDFLAGS"=>" -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/zlib /var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/zlib/libz.a  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/openssl  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/gdbm/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/yaml/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/libffi/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/ncurses/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/readline/build/lib ", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "./configure                                   --prefix=/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/ruby/build                                   --enable-bundled-libyaml                                   --without-gmp                                   --disable-dtrace                                   --enable-debug-env                                   --disable-install-rdoc"]
checking for ruby... /Users/senthilnayagam/.rvm/rubies/ruby-2.4.0/bin/ruby
config.guess already exists
config.sub already exists
checking build system type... x86_64-apple-darwin16.6.0
checking host system type... x86_64-apple-darwin16.6.0
checking target system type... x86_64-apple-darwin16.6.0
checking for clang... clang
checking for gcc... (cached) clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether clang needs -traditional... no
checking for ld... ld
checking whether the linker is GNU ld... no
checking whether clang -E accepts -o... yes
checking for real target cpu... x86_64
checking for ranlib... ranlib
checking for ar... ar
checking for ar D option... no
checking for as... as
checking for objdump... objdump
checking for objcopy... no
checking for gobjcopy... no
checking for nm... nm
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for dtrace... dtrace
checking for dot... no
checking for doxygen... no
checking for pkg-config... pkg-config
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS=" -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/zlib /var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/zlib/libz.a  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/openssl  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/gdbm/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/yaml/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/libffi/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/ncurses/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/readline/build/lib "
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"1", "CFLAGS"=>" -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/zlib  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/openssl/include  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/gdbm/build/include  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/yaml/build/include  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/libffi/build/lib/libffi-3.2.1/include  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/ncurses/build/include  -I/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/readline/build/include ", "LDFLAGS"=>" -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/zlib /var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/zlib/libz.a  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/openssl  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/gdbm/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/yaml/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/libffi/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/ncurses/build/lib  -L/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/readline/build/lib ", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "./configure                                   --prefix=/var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc/ruby/build                                   --enable-bundled-libyaml                                   --without-gmp                                   --disable-dtrace                                   --enable-debug-env                                   --disable-install-rdoc"]

senthilnayagam avatar Jul 18 '17 04:07 senthilnayagam

Hi @senthilnayagam Thanks for letting me know. Please re-run with the option --clean-tmpdir or just delete /var/folders/l4/f5_wfby913j97tfshf5ddvl80000gn/T/rubyc and it should work.

pmq20 avatar Jul 18 '17 04:07 pmq20

@pmq20 I can confirm that given the same issue, passing --clean-tmpdir solved it.

nbr avatar Jul 18 '17 16:07 nbr

compilation has happened :)

./a.out --version ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

senthilnayagam avatar Jul 19 '17 04:07 senthilnayagam

@senthilnayagam Congratulations! And that a.out is just a compact Ruby interpreter that you could toss around portably. If you need to compile with your project code into it, you need to pass more arguments to rubyc.

pmq20 avatar Jul 19 '17 04:07 pmq20

@nbr Thanks for confirming this. I'll make enhancement so that this option could be made automatic.

pmq20 avatar Jul 20 '17 02:07 pmq20