Page MenuHomeFreeBSD

fix tar's test builds with WITH_TESTS= in src.conf
ClosedPublic

Authored by op on Aug 6 2016, 6:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 3 2024, 9:15 AM
Unknown Object (File)
Feb 19 2024, 6:35 PM
Unknown Object (File)
Jan 12 2024, 9:45 PM
Unknown Object (File)
Dec 20 2023, 4:54 AM
Unknown Object (File)
Dec 19 2023, 9:04 AM
Unknown Object (File)
Dec 2 2023, 4:29 PM
Unknown Object (File)
Oct 18 2023, 9:12 AM
Unknown Object (File)
Sep 27 2023, 1:18 AM
Subscribers

Details

Summary

On opBSD / HardenedBSD (which is based on FreeBSD 10-STABLE) when the base system builds with enabled PIE, the tar's test compilation gets wrong. The attached patch fixes the problem.

opBSD: fix tar's test builds with WITH_TESTS= in src.conf

--8<--
(cd /usr/src/usr.bin/tar/tests &&  NO_SUBDIR=1 make -f /usr/src/usr.bin/tar/tests/Makefile _RECURSING_PROGS=t  PROG=bsdtar_test  DEPENDFILE=.depend.bsdtar_test .MAKE.DEPENDFILE=.depend.bsdtar_test  )
cc -O2 -pipe -pipe -march=core-avx2  -DHARDENEDBSD -DPLATFORM_CONFIG_H=\"/usr/src/lib/libarchive/config_freebsd.h\" -static -I/usr/src/lib/libarchive -I/usr/obj/usr/src/usr.bin/tar/tests -I/usr/src/contrib/libarchive/tar -I/usr/src/contrib/libarchive/test_utils -fPIE -std=gnu99 -Qunused-arguments  -fstack-protector    -pie -Wl,-z,relro -Wl,-z,now -o bsdtar_test test_0.o test_basic.o test_copy.o test_empty_mtree.o test_extract_tar_bz2.o test_extract_tar_grz.o test_extract_tar_gz.o test_extract_tar_lrz.o test_extract_tar_lz.o test_extract_tar_lz4.o test_extract_tar_lzma.o test_extract_tar_lzo.o test_extract_tar_xz.o test_format_newc.o test_help.o test_leading_slash.o test_missing_file.o test_option_C_upper.o test_option_H_upper.o test_option_L_upper.o test_option_O_upper.o test_option_T_upper.o test_option_U_upper.o test_option_X_upper.o test_option_a.o test_option_b.o test_option_b64encode.o test_option_exclude.o test_option_gid_gname.o test_option_grzip.o test_option_j.o test_option_k.o test_option_keep_newer_files.o test_option_lrzip.o test_option_lz4.o test_option_lzma.o test_option_lzop.o test_option_n.o test_option_newer_than.o test_option_nodump.o test_option_older_than.o test_option_passphrase.o test_option_q.o test_option_r.o test_option_s.o test_option_uid_uname.o test_option_uuencode.o test_option_xz.o test_option_z.o test_patterns.o test_print_longpath.o test_stdio.o test_strip_components.o test_symlink_dir.o test_version.o main.o test_utils.o -larchive
/usr/bin/ld: test_0.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
test_0.o: could not read symbols: Bad value
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[1]: stopped in /usr/src/usr.bin/tar/tests
*** Error code 1

Stop.
--8<--

Obtained-from: opBSD 418a491eed20d2603ddd1f1bd92c2c0d95094002

Failed build: http://nyi-01.build.hardenedbsd.org:8180/jenkins/job/HardenedBSD-10-STABLE-amd64/515/
Fixed build with the patch: http://jenkins.hardenedbsd.org:8180/jenkins/job/HardenedBSD-10-STABLE-amd64/516/

Test Plan

cd /usr/tests/usr.bin/tar; kyua test

...
functional_test:test_symlink_dir -> passed [0.047s]
functional_test:test_version -> passed [0.031s]

Results file id is usr_tests_usr.bin_tar.20160806-203802-949812
Results saved to /root/.kyua/store/results.usr_tests_usr.bin_tar.20160806-203802-949812.db

55/55 passed (0 failed)
root@hbsd10stable:/usr/tests/usr.bin/tar #

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

op retitled this revision from to fix tar's test builds with WITH_TESTS= in src.conf.
op updated this object.
op edited the test plan for this revision. (Show Details)
op added reviewers: delphij, bdrewery, ngie.
op set the repository for this revision to rS FreeBSD src repository - subversion.
op added reviewers: jmmv, jmg.
op edited the test plan for this revision. (Show Details)
op updated this object.
ngie edited edge metadata.
ngie added inline comments.
usr.bin/tar/tests/Makefile
13

This was a carryover from pre-r289195 with usr.bin/tar/test/Makefile -- it should have been in LDFLAGS to begin with.

This revision is now accepted and ready to land.Aug 6 2016, 6:58 PM