Open TApplencourt opened 2 years ago
For the first issue, can you send a PR to https://github.com/microsoft/mimalloc? We just copied source files from that project.
For the second issue, I guess that ipcx enables LTO by default and therefore your .o files aren't in the ELF file format. My theory is that ar
couldn't read symbol tables of your .o files and therefore failed to create an index. Fortunately, lld doesn't need a symbol table in an archive, so please try again with make LDFLAGS=-fuse-ld=lld
.
Thanks for the quick reply!
For the first issue, can you send a PR to https://github.com/microsoft/mimalloc? We just copied source files from that project.
I opened the PR in minimalloc
. https://github.com/microsoft/mimalloc/pull/588
For the second issue, I guess that ipcx enables LTO by default and therefore your .o files aren't in the ELF file format. My theory is that ar couldn't read symbol tables of your .o files and therefore failed to create an index. Fortunately, lld doesn't need a symbol table in an archive, so please try again with make LDFLAGS=-fuse-ld=lld.
It did change some stuff! We got new error messages. Progress I guess :)
icpx out/tar.o out/strerror.o out/perf.o out/main.o out/hyperloglog.o out/filepath.o out/demangle.o out/compress.o out/elf/version-matcher.o out/elf/subprocess.o out/elf/relocatable.o out/elf/passes.o out/elf/output-file.o out/elf/output-chunks.o out/elf/mapfile.o out/elf/main.o out/elf/lto.o out/elf/linker-script.o out/elf/input-sections.o out/elf/input-files.o out/elf/icf.o out/elf/glob.o out/elf/gc-sections.o out/elf/dwarf.o out/elf/cmdline.o out/elf/arch-x86-64.o out/elf/arch-riscv64.o out/elf/arch-i386.o out/elf/arch-arm64.o out/elf/arch-arm32.o out/macho/yaml.o out/macho/tapi.o out/macho/output-file.o out/macho/output-chunks.o out/macho/object-file.o out/macho/mapfile.o out/macho/main.o out/macho/input-sections.o out/macho/dumper.o out/macho/dead-strip.o out/macho/cmdline.o out/macho/arch-x86-64.o out/macho/arch-arm64.o -o mold -pthread -lz -lm -ldl -Wl,-whole-archive out/mimalloc/libmimalloc.a -Wl,-no-whole-archive out/tbb/libs/libtbb.a -Wl,-push-state -Wl,-as-needed -lrt -Wl,-pop-state -lcrypto -fuse-ld=lld
ld.lld: error: undefined symbol: mold::MappedFile<mold::elf::Context<mold::elf::X86_64> >* mold::elf::find_library<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
>>> referenced by relocatable.cc
>>> out/elf/relocatable.o:(void mold::elf::combine_objects<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, std::span<std::basic_string_view<char, std::char_traits<char> >, 18446744073709551615ul>))
>>> referenced by linker-script.cc
>>> out/elf/linker-script.o:(mold::MappedFile<mold::elf::Context<mold::elf::X86_64> >* mold::elf::resolve_path<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, std::basic_string_view<char, std::char_traits<char> >))
ld.lld: error: undefined symbol: mold::MappedFile<mold::elf::Context<mold::elf::I386> >* mold::elf::find_library<mold::elf::I386>(mold::elf::Context<mold::elf::I386>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
>>> referenced by relocatable.cc
>>> out/elf/relocatable.o:(void mold::elf::combine_objects<mold::elf::I386>(mold::elf::Context<mold::elf::I386>&, std::span<std::basic_string_view<char, std::char_traits<char> >, 18446744073709551615ul>))
>>> referenced by linker-script.cc
>>> out/elf/linker-script.o:(mold::MappedFile<mold::elf::Context<mold::elf::I386> >* mold::elf::resolve_path<mold::elf::I386>(mold::elf::Context<mold::elf::I386>&, std::basic_string_view<char, std::char_traits<char> >))
ld.lld: error: undefined symbol: mold::MappedFile<mold::elf::Context<mold::elf::ARM64> >* mold::elf::find_library<mold::elf::ARM64>(mold::elf::Context<mold::elf::ARM64>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
>>> referenced by relocatable.cc
>>> out/elf/relocatable.o:(void mold::elf::combine_objects<mold::elf::ARM64>(mold::elf::Context<mold::elf::ARM64>&, std::span<std::basic_string_view<char, std::char_traits<char> >, 18446744073709551615ul>))
>>> referenced by linker-script.cc
>>> out/elf/linker-script.o:(mold::MappedFile<mold::elf::Context<mold::elf::ARM64> >* mold::elf::resolve_path<mold::elf::ARM64>(mold::elf::Context<mold::elf::ARM64>&, std::basic_string_view<char, std::char_traits<char> >))
ld.lld: error: undefined symbol: mold::MappedFile<mold::elf::Context<mold::elf::ARM32> >* mold::elf::find_library<mold::elf::ARM32>(mold::elf::Context<mold::elf::ARM32>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
>>> referenced by relocatable.cc
>>> out/elf/relocatable.o:(void mold::elf::combine_objects<mold::elf::ARM32>(mold::elf::Context<mold::elf::ARM32>&, std::span<std::basic_string_view<char, std::char_traits<char> >, 18446744073709551615ul>))
>>> referenced by linker-script.cc
>>> out/elf/linker-script.o:(mold::MappedFile<mold::elf::Context<mold::elf::ARM32> >* mold::elf::resolve_path<mold::elf::ARM32>(mold::elf::Context<mold::elf::ARM32>&, std::basic_string_view<char, std::char_traits<char> >))
ld.lld: error: undefined symbol: mold::MappedFile<mold::elf::Context<mold::elf::RISCV64> >* mold::elf::find_library<mold::elf::RISCV64>(mold::elf::Context<mold::elf::RISCV64>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
>>> referenced by relocatable.cc
>>> out/elf/relocatable.o:(void mold::elf::combine_objects<mold::elf::RISCV64>(mold::elf::Context<mold::elf::RISCV64>&, std::span<std::basic_string_view<char, std::char_traits<char> >, 18446744073709551615ul>))
>>> referenced by linker-script.cc
>>> out/elf/linker-script.o:(mold::MappedFile<mold::elf::Context<mold::elf::RISCV64> >* mold::elf::resolve_path<mold::elf::RISCV64>(mold::elf::Context<mold::elf::RISCV64>&, std::basic_string_view<char, std::char_traits<char> >))
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks again!
As to the link error, it's odd because MappedFile is defined in a header and doesn't have to be linked from other object file. I guess I need to install icpx to debug it.
icpx
should be easy to download. It's not really a super high priority for me, I don't want you to waste to many time on this.
Thanks again!
Hi,
I work at Argonne National Lab on the Aurora project (https://www.alcf.anl.gov/aurora).
icpx
is the new Intel LLVM-based compiler that is part of the OneAPI. This thing is free, you can download and install it.(To increase naming confusion, the
icpx
compiler is more or less just https://github.com/intel/llvm + some proprietary stuff)For fun, I try to see if I can use
mold
with this compiler. I found two bugs. One I can resolve, one where I need help :)Unknow argument -Kc++
PS:
clang++
should be readicpx
in the error message but 🤷🏽 . The fix is the followingIndeed
-Kc++
is a legacyicpc
compiler and not supported byicpx
. CMake use IntelLLVM as a label for the new Intel compiler. I can make a PR if you want./usr/bin/ld: out/tbb/libs/libtbb.a: error adding symbols: archive has no index; run ranlib to add one
This one I don't know. Linker is too magic for me. Maybe related to this
clang-offload-bundler
?Thanks a lot for this promising project!
Thomas