Created attachment 268948 [details] Patch for secure/lib/libcrypto/modules/Makefile.inc adding the much needed CFLAGS+=-fPIC After commit 14b9955e57cc28b61e785165b9effcbe620edb46 and without CFLAGS+=-fPIC these error messages ensues: Building shared library legacy.so Building /usr/obj/usr/src/amd64.amd64/lib/libsmutil/cf.pieo Building /usr/obj/usr/src/amd64.amd64/lib/libtelnet/genget.pieo Building /usr/obj/usr/src/amd64.amd64/lib/libipt/pt_section_file.pico Building /usr/obj/usr/src/amd64.amd64/lib/libstats/libstats.so.0 Building shared library libstats.so.0 ld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(OSSL_provider_init) ld: error: relocation R_X86_64_PC32 cannot be used against symbol '__stack_chk_guard'; recompile with -fPIC >>> defined in /usr/obj/usr/src/amd64.amd64/tmp/lib/libc.so.7 >>> referenced by legacyprov.c >>> legacyprov.pico:(ERR_set_error) ld: error: relocation R_X86_64_PC32 cannot be used against symbol '__stack_chk_guard'; recompile with -fPIC >>> defined in /usr/obj/usr/src/amd64.amd64/tmp/lib/libc.so.7 >>> referenced by legacyprov.c >>> legacyprov.pico:(ERR_set_error) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_gettable_params) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_get_params) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_get_params) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_get_params) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_get_params) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_get_params) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_get_params) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_get_params) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in ciphercommon.pico >>> referenced by ciphercommon.c >>> ciphercommon.pico:(ossl_cipher_generic_gettable_params) ld: error: relocation R_X86_64_32S cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_query) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in ciphercommon.pico >>> referenced by ciphercommon.c >>> ciphercommon.pico:(ossl_cipher_generic_get_params) ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_dispatch_table) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in ciphercommon.pico >>> referenced by ciphercommon.c >>> ciphercommon.pico:(ossl_cipher_generic_get_params) ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_dispatch_table) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in ciphercommon.pico >>> referenced by ciphercommon.c >>> ciphercommon.pico:(ossl_cipher_generic_get_params) ld: error: relocation R_X86_64_64 cannot be used against local symbol; recompile with -fPIC >>> defined in legacyprov.pico >>> referenced by legacyprov.c >>> legacyprov.pico:(legacy_dispatch_table) ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC >>> defined in ciphercommon.pico >>> referenced by ciphercommon.c >>> ciphercommon.pico:(ossl_cipher_generic_get_params) ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors) cc: error: linker command failed with exit code 1 (use -v to see invocation) *** [legacy.so] Error code 1 make[7]: stopped making "all" in /usr/src/secure/lib/libcrypto/modules/legacy
Sorry about that Trond! I -fPIC should be added to PICFLAG, but I need to check and make sure it doesn't break other architectures first. I'll back out the change and reintroduce another one incorporating your proposed patch after I run it through `make universe`.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=67b918e03475e780854a43fe4eb7c8e95f4deb29 commit 67b918e03475e780854a43fe4eb7c8e95f4deb29 Author: Enji Cooper <ngie@FreeBSD.org> AuthorDate: 2026-03-20 20:08:09 +0000 Commit: Enji Cooper <ngie@FreeBSD.org> CommitDate: 2026-03-20 20:12:26 +0000 Revert "libcrypto: compile all PIC objects with -DOPENSSL_PIC" This commit broke the build with some build options. Some validation needs to be done to confirm that moving the preprocessor argument to `secure/lib/libcrypto/Makefile.inc` works without breaking the build, but revert for now until a `tinderbox` run can be done with the change. PR: 293934 Reported by: Jenkins, Trond Endrestøl This reverts commit 14b9955e57cc28b61e785165b9effcbe620edb46. secure/lib/libcrypto/modules/Makefile.inc | 2 -- 1 file changed, 2 deletions(-)