Cyan4973 / FiniteStateEntropy

New generation entropy codecs : Finite State Entropy and Huff0
BSD 2-Clause "Simplified" License
1.33k stars 143 forks source link

Build fails because 32 bit absolute addressing isn't supported #71

Closed MarcusJohnson91 closed 8 years ago

MarcusJohnson91 commented 8 years ago

I'm on OS X, just did a fresh clone of the repo, and clang outputs the following when calling make.

I'm currently using the beta of Xcode 8, but this issue has been ongoing for a while.

make CFLAGS="-march=native -ofast" LDFLAGS="-flto"

/Applications/Xcode-beta.app/Contents/Developer/usr/bin/make -C programs test cc -I../lib -march=native -ofast -flto probaGenerator.c -o probagen cc -I../lib -march=native -ofast -flto ../lib/huf_decompress.c ../lib/entropy_common.c bench.c commandline.c fileio.c xxhash.c zlibh.c ../lib/fse_decompress.c ../lib/fse_compress.c ../lib/fseU16.c ../lib/huf_compress.c -o fse ./probagen 20% Binary file generator Generating 1023 KB with P=20.00% File proba.bin generated \ compress using FSE ** ./fse -f proba.bin tmp FSE : Finite State Entropy, 64-bits demo by Yann Collet (Sep 4 2016) Compressed 1048575 bytes into 474414 bytes ==> 45.24%
./fse -df tmp result FSE : Finite State Entropy, 64-bits demo by Yann Collet (Sep 4 2016) Decoded 1048575 bytes
diff proba.bin result \ compress using HUF ** ./fse -fh proba.bin tmp FSE : Finite State Entropy, 64-bits demo by Yann Collet (Sep 4 2016) Compressed 1048575 bytes into 478412 bytes ==> 45.62%
./fse -df tmp result FSE : Finite State Entropy, 64-bits demo by Yann Collet (Sep 4 2016) Decoded 1048575 bytes
diff proba.bin result \ compress using zlibh ** ./fse -fz proba.bin tmp FSE : Finite State Entropy, 64-bits demo by Yann Collet (Sep 4 2016) Compressed 1048575 bytes into 478213 bytes ==> 45.61%
./fse -df tmp result FSE : Finite State Entropy, 64-bits demo by Yann Collet (Sep 4 2016) Decoded 1048575 bytes
diff proba.bin result rm result rm proba.bin rm tmp cc -I../lib -march=native -ofast -flto fullbench.c xxhash.c ../lib/fse_decompress.c ../lib/fse_compress.c ../lib/fseU16.c ../lib/huf_compress.c ../lib/huf_decompress.c ../lib/entropy_common.c -o fullbench LLVM ERROR: 32-bit absolute addressing is not supported in 64-bit mode clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: * [fullbench] Error 1 make: * [test] Error 2

Cyan4973 commented 8 years ago

I suspect the issue is in fullbench. It contains some externally supplied experimental code, which is usually not compiled because it's behind a macro condition. -march likely trigger some of them.

I'll make a cleaning a the near future.

MarcusJohnson91 commented 8 years ago

I just tested it again by running make and that issue didn't appear, so it seems like -march=native probably was the cause.

Cyan4973 commented 8 years ago

I removed a bunch of experimental codes from fullbench, so I guess it should work better with -march=native enabled now.

MarcusJohnson91 commented 8 years ago

That fixed it, thank you.