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

cannot compile ruby-packer from source in macos majave with Ruby 2.5.3

Open pc-gliu opened this issue 6 years ago • 1 comments

configure: ruby library version = 2.5.0 configure: creating ./config.status config.status: creating GNUmakefile config.status: creating Makefile config.status: creating ruby-2.5.pc

Configuration summary for ruby version 2.5.1

  • Installation prefix: /var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/r
    ubyc/ruby_install_1
  • exec prefix: ${prefix}
  • arch: x86_64-darwin18
  • site arch: ${arch}
  • RUBY_BASE_NAME: ruby
  • ruby lib prefix: ${libdir}/${RUBY_BASE_NAME}
  • site libraries path: ${rubylibprefix}/${sitearch}
  • vendor path: ${rubylibprefix}/vendor_ruby
  • target OS: darwin18
  • compiler: clang
  • with pthread: yes
  • enable shared libs: no
  • dynamic library ext: bundle
  • CFLAGS: ${optflags} ${debugflags} ${warnflags}
  • LDFLAGS: -L. -fstack-protector -L/usr/local/lib
  • optflags: -O3
  • debugflags: -ggdb3
  • warnflags: -Wall -Wextra -Wno-unused-parameter
    -Wno-parentheses -Wno-long-long
    -Wno-missing-field-initializers
    -Wno-tautological-compare
    -Wno-parentheses-equality
    -Wno-constant-logical-operand -Wno-self-assign
    -Wunused-variable -Wimplicit-int -Wpointer-arith
    -Wwrite-strings -Wdeclaration-after-statement
    -Wshorten-64-to-32
    -Wimplicit-function-declaration
    -Wdivision-by-zero -Wdeprecated-declarations
    -Wextra-tokens
  • strip command: strip -A -n
  • install doc: yes
  • man page type: doc

-> CI=true ENCLOSE_IO_USE_ORIGINAL_RUBY=1 CFLAGS=\ -fPIC\ -O3\ -fno-fast-math\ -ggdb3\ -Os\ -fdata-sections\ -ffunction-sections\ -pipe\ \ -I/var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/local/include\ \ -I/var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/local/lib/libffi-3.2.1/include\ LDFLAGS='' ENCLOSE_IO_RUBYC_1ST_PASS=1 ENCLOSE_IO_RUBYC_2ND_PASS='' make -j4 CC = clang LD = ld LDSHARED = clang -dynamic -bundle CFLAGS = -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe -I/var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/local/include -I/var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/local/lib/libffi-3.2.1/include
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin18 -I/var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/ruby-2.5.1-0.5.0/include -I/var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/ruby-2.5.1-0.5.0 -I/var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/ruby-2.5.1-0.5.0/enc/unicode/10.0.0 -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe -I/var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/local/include -I/var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/local/lib/libffi-3.2.1/include DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector -Wl,-pie -framework Foundation
SOLIBS = LANG = en_US.UTF-8 LC_ALL = LC_CTYPE = en_US.UTF-8 Apple LLVM version 10.0.0 (clang-1000.10.44.4) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin linking miniruby Undefined symbols for architecture x86_64: "_inflate", referenced from: _autoupdate in autoupdate_autoupdate.o "_inflateEnd", referenced from: _autoupdate in autoupdate_autoupdate.o "inflateInit2", referenced from: _autoupdate in autoupdate_autoupdate.o "_uncompress", referenced from: _sqfs_decompressor_zlib in squash_decompress.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [miniruby] Error 1 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/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/local/include -I/var/folders/gj/vgwp8q6s2n7_wxrj05pb1xjxy7dzks/T/rubyc/local/lib/libffi-3.2.1/include ", "LDFLAGS"=>"", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"1", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "make -j4"] rake aborted! Command failed with status (1): [/Users/gliu/.rbenv/versions/2.5.3/bin/ruby...] /Users/gliu/Documents/ruby-packer/master/ruby-packer/Rakefile:19:in block in <top (required)>' /Users/gliu/.rbenv/versions/2.5.3/bin/bundle:23:in load' /Users/gliu/.rbenv/versions/2.5.3/bin/bundle:23:in `

' Tasks: TOP => rubyc (See full trace by running task with --trace)

pc-gliu avatar Jan 18 '19 01:01 pc-gliu

hey @pc-gliu, I was able to get rid of this error by doing 2 things:

  • use this fork: https://github.com/kontena/ruby-packer (ruby 2.6.0)
  • patching lib/compiler.rb, line 1001: @ldflags += " #{@utils.escape libz} -lz" if File.exist? libz (I added -lz)

did avatar Apr 01 '19 12:04 did