[I figured I'd make a formal submittal out of this subject that I'd had exchanges about on some of the mailing lists.] lang/gcc49, lang/gcc5, and devel/powerpc64-gcc all bind built programs to /libexec/ld-elf32.so.1 for -m32 on powerpc64. I'm told it should be /libexec/ld-elf.so.1 instead. Example main.c program processed by gcc49: int main(void) { return 0; } # gcc49 -m32 main.c # file a.out a.out: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf32.so.1, FreeBSD-style, for FreeBSD 10.2 (1002503), not stripped gcc5 and powerpc64-gcc get the same. A possible fix via an addition to lang/gcc5's and devel/powerpc64-gcc's patch-gcc-freebsd-powerpc64 for the freebsd64.h content would look like (tabs likely not preserved): +@@ -154,7 +167,7 @@ + { "link_os_freebsd_spec32", LINK_OS_FREEBSD_SPEC32 }, \ + { "link_os_freebsd_spec64", LINK_OS_FREEBSD_SPEC64 }, + +-#define FREEBSD_DYNAMIC_LINKER32 "/libexec/ld-elf32.so.1" ++#define FREEBSD_DYNAMIC_LINKER32 "/libexec/ld-elf.so.1" + #define FREEBSD_DYNAMIC_LINKER64 "/libexec/ld-elf.so.1" + + #define LINK_OS_FREEBSD_SPEC_DEF32 "\ It appears that lang/gcc49, lang/gcc5-devel, and lang/gcc6-devel do not have a patch-gcc-freebsd-powerpc64 (yet?). Nor lang/gcc48 or older. At least for gcc49 the content of a patch for this issue could be similar from what I can see. I've not looked at the details for the others.
Currently all active gcc branches are broken for FreeBSD powerpc64. Once the break is fixed I'll apply a suitable fix. It'll take some time.
A commit references this bug: Author: andreast Date: Sat Jan 9 11:56:21 UTC 2016 New revision: 405619 URL: https://svnweb.freebsd.org/changeset/ports/405619 Log: Bring the fixes mentioned below from upstream to our gcc-5.3 release port. [1]: https://gcc.gnu.org/ml/gcc-patches/2015-12/msg02057.html [2]: https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00685.html PR: 205394, 205440 Approved by: gerald (maintainer) Changes: head/lang/gcc5/files/patch-gcc-freebsd-powerpc64
devel/powerpc64-gcc that I had listed in the submittal was not updated. Updating /usr/ports to -r405653 and rerunning portmaster -DK devel/powerpc64-gcc still ends up with (found via find . . . -exec grep . . . -print): #define FREEBSD_DYNAMIC_LINKER32 "/libexec/ld-elf32.so.1" #define FREEBSD_DYNAMIC_LINKER64 "/libexec/ld-elf.so.1" /usr/obj/portswork/usr/ports/devel/powerpc64-gcc/work/gcc-5.2.0/gcc/config/rs6000/freebsd64.h I'm not sure if Bug 205440 should be "unclosed" or if a new bug should be submitted: lang/gcc49 and lang/gcc5 seem to have been updated just fine by their recent updates.
A commit references this bug: Author: andreast Date: Sun Jan 10 20:11:52 UTC 2016 New revision: 405744 URL: https://svnweb.freebsd.org/changeset/ports/405744 Log: Bring the fixes mentioned below from upstream to our gcc-5.2 powerpc64-gcc port. [1]: https://gcc.gnu.org/ml/gcc-patches/2015-12/msg02057.html [2]: https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00685.html PR: 205394, 205440 Approved by: bapt (maintainer) Changes: head/devel/powerpc64-gcc/files/patch-gcc-freebsd-powerpc64