google / brunsli

Practical JPEG Repacker
MIT License
738 stars 51 forks source link

Compilation on Mac #69

Closed mobiliodevelopment closed 4 years ago

mobiliodevelopment commented 4 years ago

Hello there!

I've run compilation and got error: rm -f libbrotli.a ar -crs libbrotli.a bin/obj/c/common/dictionary.o bin/obj/c/common/transform.o bin/obj/c/dec/bit_reader.o bin/obj/c/dec/decode.o bin/obj/c/dec/huffman.o bin/obj/c/dec/state.o bin/obj/c/enc/backward_references.o bin/obj/c/enc/backward_references_hq.o bin/obj/c/enc/bit_cost.o bin/obj/c/enc/block_splitter.o bin/obj/c/enc/brotli_bit_stream.o bin/obj/c/enc/cluster.o bin/obj/c/enc/compress_fragment.o bin/obj/c/enc/compress_fragment_two_pass.o bin/obj/c/enc/dictionary_hash.o bin/obj/c/enc/encode.o bin/obj/c/enc/encoder_dict.o bin/obj/c/enc/entropy_encode.o bin/obj/c/enc/histogram.o bin/obj/c/enc/literal_cost.o bin/obj/c/enc/memory.o bin/obj/c/enc/metablock.o bin/obj/c/enc/static_dict.o bin/obj/c/enc/utf8_util.o c++ -Wl,-gc-sections bin/obj/c/common/ans_params.o bin/obj/c/common/constants.o bin/obj/c/common/context.o bin/obj/c/common/huffman_tree.o bin/obj/c/common/lehmer_code.o bin/obj/c/common/platform.o bin/obj/c/common/predict.o bin/obj/c/common/quant_matrix.o bin/obj/c/dec/ans_decode.o bin/obj/c/dec/brunsli_decode.o bin/obj/c/dec/context_map_decode.o bin/obj/c/dec/decode.o bin/obj/c/dec/histogram_decode.o bin/obj/c/dec/huffman_decode.o bin/obj/c/dec/huffman_table.o bin/obj/c/dec/jpeg_data_writer.o bin/obj/c/dec/state.o bin/obj/c/enc/ans_encode.o bin/obj/c/enc/brunsli_encode.o bin/obj/c/enc/context_map_encode.o bin/obj/c/enc/encode.o bin/obj/c/enc/histogram_encode.o bin/obj/c/enc/jpeg_data_reader.o bin/obj/c/enc/jpeg_huffman_decode.o bin/obj/c/enc/write_bits.o bin/obj/c/tools/cbrunsli.o \ -lm -Lthird_party/brotli -lbrotli -o bin/cbrunsli ld: unknown option: -gc-sections clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [cbrunsli] Error 1

mobiliodevelopment commented 4 years ago

Update - i edit Makefile and this is original line N:18: LDFLAGS += -Wl,-gc-sections

If i edit it as: LDFLAGS += -Wl

Then ld can finish linking without issue.

eustas commented 4 years ago

Hello. Please consider using CMake / Bazel instead of plain make.