Comments (6)
I cannot debug it myself because Fedora doesn't provide a Docker image for riscv64.
Can you run the failing tests as bash -x test/elf/static-pie.sh
and bash -x test/elf/ifunc-static-pie.sh
and copy-n-paste the output?
from mold.
running the tests alone they pass okay, but as part of the rpm build they fail
The following tests FAILED:
122 - riscv64-ifunc-static-pie (Failed)
225 - riscv64-static-pie (Failed)
Errors while running CTest
error: Bad exit status from /var/tmp/rpm-tmp.aoysuV (%check)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.aoysuV (%check)
[mockbuild@a460513229fd4580ab9226e651e0bfbe ~]$ cd /builddir/build/BUILD/mold-2.32.0/
[mockbuild@a460513229fd4580ab9226e651e0bfbe mold-2.32.0]$ bash -x test/elf/static-pie.sh
++ dirname test/elf/static-pie.sh
+ . test/elf/common.inc
++ export LC_ALL=C
++ LC_ALL=C
++ '[' -z '' ']'
++++ uname -m
+++ canonical_name riscv64
+++ case $1 in
+++ echo riscv64
++ MACHINE=riscv64
++ '[' -z '' ']'
++ TESTDIR=out/test/elf/riscv64
++ CC=cc
++ CXX=c++
++ GCC=gcc
++ GXX=g++
++ OBJDUMP=objdump
++ OBJCOPY=objcopy
++ STRIP=strip
++ QEMU=
++ '[' riscv64 = x86_64 -o riscv64 = i686 -o riscv64 = arm ']'
++ '[' riscv64 = aarch64 ']'
++ trap 'on_error $LINENO' ERR
++ trap on_exit EXIT
+++ basename test/elf/static-pie.sh .sh
++ testname=static-pie
++ echo -n 'Testing static-pie ... '
Testing static-pie ... ++ t=out/test/elf/riscv64/static-pie
++ mkdir -p out/test/elf/riscv64/static-pie
+ test_cflags -static-pie
+ echo 'int main() {}'
+ cc -static-pie -o /dev/null -xc -
+ cat
+ cc -o out/test/elf/riscv64/static-pie/a.o -c -xc - -fPIE
+ cc -B. -o out/test/elf/riscv64/static-pie/exe1 out/test/elf/riscv64/static-pie/a.o -static-pie
+ out/test/elf/riscv64/static-pie/exe1
+ grep -q 'Hello world'
+ cc -B. -o out/test/elf/riscv64/static-pie/exe2 out/test/elf/riscv64/static-pie/a.o -static-pie -Wl,--no-relax
+ out/test/elf/riscv64/static-pie/exe2
+ grep -q 'Hello world'
+ on_exit
+ echo OK
OK
+ exit 0
[mockbuild@a460513229fd4580ab9226e651e0bfbe mold-2.32.0]$ bash -x test/elf/ifunc-static-pie.sh
++ dirname test/elf/ifunc-static-pie.sh
+ . test/elf/common.inc
++ export LC_ALL=C
++ LC_ALL=C
++ '[' -z '' ']'
++++ uname -m
+++ canonical_name riscv64
+++ case $1 in
+++ echo riscv64
++ MACHINE=riscv64
++ '[' -z '' ']'
++ TESTDIR=out/test/elf/riscv64
++ CC=cc
++ CXX=c++
++ GCC=gcc
++ GXX=g++
++ OBJDUMP=objdump
++ OBJCOPY=objcopy
++ STRIP=strip
++ QEMU=
++ '[' riscv64 = x86_64 -o riscv64 = i686 -o riscv64 = arm ']'
++ '[' riscv64 = aarch64 ']'
++ trap 'on_error $LINENO' ERR
++ trap on_exit EXIT
+++ basename test/elf/ifunc-static-pie.sh .sh
++ testname=ifunc-static-pie
++ echo -n 'Testing ifunc-static-pie ... '
Testing ifunc-static-pie ... ++ t=out/test/elf/riscv64/ifunc-static-pie
++ mkdir -p out/test/elf/riscv64/ifunc-static-pie
+ test_cflags -static-pie
+ echo 'int main() {}'
+ cc -static-pie -o /dev/null -xc -
+ supports_ifunc
+ is_musl
+ ldd --version
+ grep -q musl
+ echo 'void x() __attribute__((ifunc("y"))); void *y() { return 0; }'
+ cc -c -o /dev/null -xc -
+ cat
+ cc -o out/test/elf/riscv64/ifunc-static-pie/a.o -c -xc - -fPIC
+ cc -B. -o out/test/elf/riscv64/ifunc-static-pie/exe2 out/test/elf/riscv64/ifunc-static-pie/a.o -static-pie
+ out/test/elf/riscv64/ifunc-static-pie/exe2
+ grep -q 'Hello world'
+ on_exit
+ echo OK
OK
+ exit 0
from mold.
ctest
runs the scripts just like you manually did, so it is odd that the scripts failed only for the rpm build. I'm not familiar with the RPM packaging system. Can you debug a little bit to see which command in the scripts failed?
from mold.
rpmbuild output the full failure
125/338 Test #122: riscv64-ifunc-static-pie ....................***Failed 3.05 sec
++ dirname /builddir/build/BUILD/mold-2.32.0/test/elf/ifunc-static-pie.sh
+ . /builddir/build/BUILD/mold-2.32.0/test/elf/common.inc
++ export LC_ALL=C
++ LC_ALL=C
++ '[' -z riscv64 ']'
++ '[' -z '' ']'
++ TESTDIR=out/test/elf/riscv64
++ CC=cc
++ CXX=c++
++ GCC=gcc
++ GXX=g++
++ OBJDUMP=objdump
++ OBJCOPY=objcopy
++ STRIP=strip
++ QEMU=
++ '[' riscv64 = x86_64 -o riscv64 = i686 -o riscv64 = arm ']'
++ '[' riscv64 = aarch64 ']'
++ trap 'on_error $LINENO' ERR
++ trap on_exit EXIT
+++ basename /builddir/build/BUILD/mold-2.32.0/test/elf/ifunc-static-pie.sh .sh
++ testname=ifunc-static-pie
++ echo -n 'Testing ifunc-static-pie ... '
Testing ifunc-static-pie ... ++ t=out/test/elf/riscv64/ifunc-static-pie
++ mkdir -p out/test/elf/riscv64/ifunc-static-pie
+ test_cflags -static-pie
+ echo 'int main() {}'
+ cc -static-pie -o /dev/null -xc -
+ supports_ifunc
+ is_musl
+ ldd --version
+ grep -q musl
+ echo 'void x() __attribute__((ifunc("y"))); void *y() { return 0; }'
+ cc -c -o /dev/null -xc -
+ cat
+ cc -o out/test/elf/riscv64/ifunc-static-pie/a.o -c -xc - -fPIC
+ cc -B. -o out/test/elf/riscv64/ifunc-static-pie/exe2 out/test/elf/riscv64/ifunc-static-pie/a.o -static-pie
+ out/test/elf/riscv64/ifunc-static-pie/exe2
+ grep -q 'Hello world'
++ on_error 27
++ code=1
++ echo 'command failed: 27: grep -q '\''Hello world'\'''
command failed: 27: grep -q 'Hello world'
++ trap - EXIT
++ exit 1
231/338 Test #225: riscv64-static-pie ..........................***Failed 2.81 sec
++ dirname /builddir/build/BUILD/mold-2.32.0/test/elf/static-pie.sh
+ . /builddir/build/BUILD/mold-2.32.0/test/elf/common.inc
++ export LC_ALL=C
++ LC_ALL=C
++ '[' -z riscv64 ']'
++ '[' -z '' ']'
++ TESTDIR=out/test/elf/riscv64
++ CC=cc
++ CXX=c++
++ GCC=gcc
++ GXX=g++
++ OBJDUMP=objdump
++ OBJCOPY=objcopy
++ STRIP=strip
++ QEMU=
++ '[' riscv64 = x86_64 -o riscv64 = i686 -o riscv64 = arm ']'
++ '[' riscv64 = aarch64 ']'
++ trap 'on_error $LINENO' ERR
++ trap on_exit EXIT
+++ basename /builddir/build/BUILD/mold-2.32.0/test/elf/static-pie.sh .sh
++ testname=static-pie
++ echo -n 'Testing static-pie ... '
Testing static-pie ... ++ t=out/test/elf/riscv64/static-pie
++ mkdir -p out/test/elf/riscv64/static-pie
+ test_cflags -static-pie
+ echo 'int main() {}'
+ cc -static-pie -o /dev/null -xc -
+ cat
+ cc -o out/test/elf/riscv64/static-pie/a.o -c -xc - -fPIE
+ cc -B. -o out/test/elf/riscv64/static-pie/exe1 out/test/elf/riscv64/static-pie/a.o -static-pie
+ out/test/elf/riscv64/static-pie/exe1
+ grep -q 'Hello world'
++ on_error 14
++ code=1
++ echo 'command failed: 14: grep -q '\''Hello world'\'''
command failed: 14: grep -q 'Hello world'
++ trap - EXIT
++ exit 1
from mold.
the rpmbuild puts its output in a slightly different location. The binaries segfault from those two tests
[mockbuild@a460513229fd4580ab9226e651e0bfbe mold-2.32.0]$ redhat-linux-build/out/test/elf/riscv64/static-pie/exe1
Segmentation fault (core dumped)
[mockbuild@a460513229fd4580ab9226e651e0bfbe mold-2.32.0]$ redhat-linux-build/out/test/elf/riscv64/ifunc-static-pie/exe2
Segmentation fault (core dumped)
from mold.
http://fedora.riscv.rocks:3000/davidlt/-/packages/container/fedora-generic/40 has info on getting a fedora container image
from mold.
Related Issues (20)
- Failing tests on Alpine with 2.32.1 HOT 5
- Runtime error with Intel MKL and FEAST solver HOT 2
- VTT and discarded COMDAT error HOT 3
- x86_64-as-needed-weak (Failed) HOT 4
- Undefined reference when linking shared libraries not raised HOT 1
- mold: error: undefined symbol: OPENSSL_ia32cap_P HOT 7
- cosmic-applets, rust, out of memory when linking? HOT 6
- unknown command line option: -dynamic-list-data HOT 1
- Regarding no-execute HOT 3
- Alpinelinux 32bits build failure HOT 10
- mold 2.33.0 segfaults with --icf=all
- fatal: invalid --build-id argument: fast
- Solutions for ```__wine_spec_nt_header```? HOT 2
- gentoo-test.sh failes due to a conflict HOT 8
- Crash with `-D_GLIBCXX_ASSERTIONS` when building dtrace HOT 4
- void* sizeof ... 0 HOT 1
- Fails to build ninja with mold linker on gcc15 HOT 5
- Linking with mold breaks initialization of thread local storage in Rust under FreeBSD on AMD64 HOT 6
- Compilation Issue HOT 4
- riscv64-absolute-symbols fails with GCC 14 HOT 9
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.