triez icon indicating copy to clipboard operation
triez copied to clipboard

build fails with ruby 2.5.0

Open gsar opened this issue 7 years ago • 2 comments

looks like $(AR) changed to libtool -static which doesn't accept -r:

current directory: /Users/gsar/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/triez-1.0.5/ext
/Users/gsar/.rbenv/versions/2.5.0/bin/ruby -r ./siteconf20180328-53094-1nbp0vx.rb extconf.rb
creating Makefile

current directory: /Users/gsar/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/triez-1.0.5/ext
make "DESTDIR=" clean

current directory: /Users/gsar/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/triez-1.0.5/ext
make "DESTDIR="
compiling triez.cc
mkdir -p build && cd build && clang -O3 -std=c99 -Wall -pedantic -fPIC -c -I.. ../hat-trie/*.c && libtool -static -r libtries.a *.o
../hat-trie/hat-trie.c:250:18: warning: taking the absolute value of unsigned type 'unsigned int' has no effect [-Wabsolute-value]
        if (d <= abs(left_m - right_m) && left_m + cs[j + 1] < all_m) {
                 ^
../hat-trie/hat-trie.c:250:18: note: remove the call to 'abs' since unsigned values cannot be negative
        if (d <= abs(left_m - right_m) && left_m + cs[j + 1] < all_m) {
                 ^~~
1 warning generated.
error: /Library/Developer/CommandLineTools/usr/bin/libtool: unknown option character `r' in: -r
Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
make: *** [build/libtries.a] Error 1

make failed, exit code 2

gsar avatar Mar 28 '18 18:03 gsar

Thanks for reporting!

Seems caused by this change: https://github.com/ruby/ruby/commit/bf87195ea37d9607e21e50a1e7df63a2cdd6451f

@gsar Just pushed a new version (1.0.6) to fix building when $(AR) is libtool -static, can you try if it works for you?

luikore avatar Mar 29 '18 03:03 luikore

FWIW the build worked for me on Ruby 2.4.2

gyfis avatar Jan 16 '19 07:01 gyfis