Bug 271726 - lib/libc: tests fail with PIE
Summary: lib/libc: tests fail with PIE
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: tests (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-testing (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-30 17:08 UTC by Robert Clausecker
Modified: 2023-05-30 17:08 UTC (History)
0 users

See Also:


Attachments
make check log (216.13 KB, text/plain)
2023-05-30 17:08 UTC, Robert Clausecker
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Clausecker freebsd_committer freebsd_triage 2023-05-30 17:08:26 UTC
Created attachment 242498 [details]
make check log

On 14-CURRENT, commit b50e1465e88dcf5f6f008892d802df010e7029d1.

I'm trying to run the libc test suite by doing

    cd /usr/src/lib/libc && make check

this fails with PIC errors when the system is build with WITH_PIE (default on amd64):

cc -O2 -pipe -fno-common -DTEST_LONG_DOUBLE -D__HAVE_LONG_DOUBLE -I/usr/src/lib/libc/tests/gen -I/usr/src/include -fPIE -g -gz=zlib -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Qunused-arguments  -Wl,-zrelro -pie  -o getentropy_test.full getentropy_test.o  -lprivateatf-c -L/usr/obj/usr/src/amd64.amd64/lib/libc -lc
ld: error: cannot preempt symbol: _DYNAMIC
>>> referenced by libc_start1.c:144 (/usr/src/lib/libc/csu/libc_start1.c:144)
>>>               libc_start1.o:(__libc_start1) in archive /usr/obj/usr/src/amd64.amd64/lib/libc/libc.a

See also attached log file.

The test suite runs without problems when instead being built with WITHOUT_PIE=yes in /etc/src.conf