Comments (25)
@Logarithmus They failed because a stack frame was not properly aligned to a 16-byte boundary. The x86-64 psABI requires that when you make a function call (i.e. when you execute call
instruction), %rsp must be aligned to a 16-byte boundary.
call
instruction pushes a 8-byte return address to the stack. So, at the beginning of a function, %rsp is not aligned to a 16-byte boundary, so you need to adjust %rsp (e.g. pushing %rsp by 8 bytes) before making another call
. I didn't do that.
If you do not do that, some instructions sensitive to alignment requirement may fail. glibc's printf is not sensitive to the alignment requirement unless you try to print out floating-point values (if you try to do that, it segfaults). It looks like musl's printf is always sensitive. So the tests failed.
from mold.
No, it's odd. Is there any way to download the object files from the CI or run the same thing on my local environment?
from mold.
@rui314 https://hub.docker.com/r/voidlinux/voidlinux-musl
from mold.
Thanks. I'll give it a try.
from mold.
A noob question, but the environment built by docker pull voidlinux/voidlinux-musl
doesn't contain any developer tools. How can I install a compiler, make and so on into it? I'm not familiar with Void Linux's package manager.
from mold.
from mold.
This test assumed that the default output is position-dependent, which actually depends on how your compiler was built. I made it explicit by adding -no-pie
.
from mold.
@rui314 what about a new tag?
from mold.
Do you mean a new version of the linker, like 0.9.3?
from mold.
@rui314 yeah, you know I need a new release to use this fix in a package
from mold.
OK, let me create 0.9.3-pre1 so that you can test it.
from mold.
Please test with this tag. https://github.com/rui314/mold/tree/v0.9.3-rc1
from mold.
I created a new release candidate https://github.com/rui314/mold/tree/v0.9.3-rc2
It includes a fix of --sysroot
flag handling.
from mold.
@rui314 see #89 (comment)
from mold.
I somehow thought that test/canonical-plt.sh is the only failing test. I'll take a look at other failures.
from mold.
@rui314 I think some of them can't run successfully due to musl lacking some features of glibc e. g ifunc. So it would be nice to detect system libc somewhere in test/Makefile and conditionally skip those tests. Though some tests can be fixed I guess.
from mold.
@rui314 this thread might be helpful: https://news.ycombinator.com/item?id=22680577
from mold.
@Logarithmus Is there any way to install i386 dev tools to musl Void Linux? Or is it 64-bit only?
from mold.
Except i386 tests, I believe I fixed all musl-related failures in the main branch. Since cherrypicking these changes will be more riskier than making a full release, 0.9.3 will be a full release instead of bug-fix-only release.
from mold.
I think mold at the head of the git main branch is now cleanly built and tested on Void Linux with musl.
from mold.
@Logarithmus I tagged v0.9.3-rc3 as a new release candidate.
from mold.
@Logarithmus Is there any way to install i386 dev tools to musl Void Linux? Or is it 64-bit only?
Unfortunately, musl
doesn't support multilib (running 32-bit programs with 64-bit libc). Also Void Linux doesn't have i686-musl
variant, only glibc
one. I don't know why.
from mold.
@Logarithmus I tagged v0.9.3-rc3 as a new release candidate.
OK thanks, I'll check it out!
from mold.
@rui314 do you know why those pieces of assembly used to fail with musl
?280892f#diff-5725ceb876566e601501d9b70812c960b4fd5efaf2e8919e73a41c436fc9c308
Maybe it has to do with @PLT
stuff? What does call printf@PLT
mean by the way?
from mold.
I'm closing this bug as the bug has been fixed.
from mold.
Related Issues (20)
- GCC warnings
- common/common.h:219:3: warning: base class βstruct std::atomic<bool>β should be explicitly initialized in the copy constructor [-Wextra]
- More GCC warnings related to mold::Atomic HOT 1
- Trying to use mold for linking whole FreeBSD base and kernel - stuck at i386 BTX linking...
- Segment fault with armhf/armel binary which is linked by mold 2.4.1 HOT 6
- mold randomly segfaults HOT 7
- Mold gives warning about clang lib file, compiling with "-fsanitize=address" HOT 4
- `using mold with cargo not working anymore` HOT 4
- Report errors for certain unknown section types
- Weird tokio error in mold 2.4.1 HOT 3
- Concurrent map size is not large enough in gdb-index.cc HOT 2
- mold silently produces invalid executable (-fPIC)
- mold 2.30.0 test failure on alpinelinux HOT 4
- riscv64 test segfault with GCC 14 HOT 7
- linux/ppc64el: fails to build LLVM with `./elf/thunks.cc:257: void mold::elf::OutputSection<E>::create_range_extension_thunks(mold::elf::Context<E>&) [with E = mold::elf::PPC64V2]: Assertion `thunk->size() < max_thunk_size' failed.` HOT 10
- Spurious "not claimed by the LTO plugin" when LTO is not used HOT 2
- mold fails to link when used as a linker with rustc, gcc and with lto enabled HOT 2
- `--repro` doesn't archive input files correctly HOT 1
- common/tar.cc:109:12: warning: ignoring return value of 'int ftruncate(int, __off_t)' declared with attribute 'warn_unused_result' [-Wunused-result] HOT 2
- Consider adding `--long-plt` support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mold.