luikore / triez

fast, efficient, unicode aware HAT trie with prefix / suffix support for Ruby
MIT License
140 stars 9 forks source link

build fails with ruby 2.5.0 #8

Open gsar opened 6 years ago

gsar commented 6 years ago

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
luikore commented 6 years ago

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?

gyfis commented 5 years ago

FWIW the build worked for me on Ruby 2.4.2