Bug 270958 - math/trlan: fails to build when base built WITH_LLVM_BINUTILS
Summary: math/trlan: fails to build when base built WITH_LLVM_BINUTILS
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL: https://reviews.freebsd.org/D39754
Keywords:
Depends on:
Blocks: 258872
  Show dependency treegraph
 
Reported: 2023-04-20 18:05 UTC by Ed Maste
Modified: 2023-04-24 19:08 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2023-04-20 18:05:25 UTC
From exp-run PR 258872

https://pkg-status.freebsd.org/gohan05/data/mainamd64PR258872-default/2023-04-17_22h40m57s/logs/errors/trlan-201009_11.log

gfortran12 -O -Wl,-rpath=/usr/local/lib/gcc12 -c restart.f90
gfortran12 -O -Wl,-rpath=/usr/local/lib/gcc12 -c trlaux.f90
gfortran12 -O -Wl,-rpath=/usr/local/lib/gcc12 -c trlan77.f90
gfortran12 -O -Wl,-rpath=/usr/local/lib/gcc12 -c trl_comm_none.f90
/usr/local/bin/ar -cru ../libtrlan.a dsort2.o trl_info.o dstqrb.o trlcore.o trlan.o restart.o trlaux.o trlan77.o trl_comm_none.o
/usr/local/bin/ar: `u' modifier ignored since `D' is the default (see `U')
/usr/bin/strip: error: '/wrkdirs/usr/ports/math/trlan/work/trlan-201009/libtrlan.a': not stripping symbol '.LC0' because it is named in a relocation
*** Error code 1

Stop.
make: stopped in /usr/ports/math/trlan
Comment 1 Ed Maste freebsd_committer freebsd_triage 2023-04-21 17:42:06 UTC
Looks like this just needs

diff --git a/math/trlan/Makefile b/math/trlan/Makefile
index 0e041ececc92..5eb786339df8 100644
--- a/math/trlan/Makefile
+++ b/math/trlan/Makefile
@@ -48,7 +48,7 @@ do-build:
        @${ECHO_CMD} "Building static archive ..."
        @cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} \
                ${ALL_TARGET}
-       @${STRIP_CMD} -x -o ${WRKDIR}/libtrlan.a ${WRKSRC}/libtrlan.a
+       @${STRIP_CMD} --strip-unneeded -o ${WRKDIR}/libtrlan.a ${WRKSRC}/libtrlan.a
        @cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} \
                clean
        @${ECHO_CMD} "Building shared library ..."
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-04-24 19:07:18 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e6b5fb28a560cda9f101a2c2fc55ef70f00a2179

commit e6b5fb28a560cda9f101a2c2fc55ef70f00a2179
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-04-21 20:21:16 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-04-24 19:05:08 +0000

    math/trlan: fix build for base system WITH_LLVM_BINUTILS

    Use strip --strip-unneeded instead of strip -x.  strip -x strips all
    non-global symbols, but there are some non-global symbols referenced by
    relocations.  ELF Tool Chain strip and GNU strip silently retain those
    symbols, but LLVM strip is more strict and reports an error.

    PR:             270958
    Reviewed by:    jrm
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D39754

 math/trlan/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)