Sorry,

I probably broke lang/gcc/11 on powerpc when I changed the default
linker to ld.lld.  I guess that it needs USE_LLD = No, like lang/gcc/8
does.  I started a build of 11 with the below diff.  The build might
take a few days.  If it packages, ok to commit the diff?

C++ code from gcc 8 causes linker errors in lld, and I guess that
gcc 11 would be the same.  An example from gcc 8 on a macppc where
/usr/bin/ld = lld is,

$ cat exam.cpp
#include <iostream>
int main() { std::cout << "hi\n"; }
$ eg++ -static -o exam exam.cpp
ld: error: relocation refers to a discarded section: 
.sdata.DW.ref.__gxx_personality_v0
>>> defined in 
>>> /usr/local/lib/gcc/powerpc-unknown-openbsd6.9/8.4.0/../../../libestdc++.a(eh_personality.o)
...

Also, gcc 11 started using -Wl,--relax.  ld.bfd needs this flag to
link large shlibs or exes, but lld would fail with "unknown argument"
error.  Therefore, no powerpc package of gcc 11 can exist (after the
lld switch bumped _SYSTEM_VERSION-powerpc), so I propose no change to
REVISION.

--George

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/gcc/11/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile    17 Aug 2021 20:22:02 -0000      1.2
+++ Makefile    22 Aug 2021 01:24:54 -0000
@@ -128,6 +128,8 @@ CONFIGURE_ENV += ${EXTRA_ENV}
 MAKE_ENV += ${EXTRA_ENV}
 
 .if ${MACHINE_ARCH} == "powerpc"
+# powerpc lld can't link C++ code from gcc
+USE_LLD = No
 CONFIGURE_ENV += LDFLAGS="-Wl,--relax"
 .endif
 

Reply via email to