[Bug 205440] lang/gcc49, lang/gcc5, devel/powerpc64-gcc on powerpc64: binds a.out to /libexec/ld-elf32.so.1 instead of /libexec/ld-elf.so.1

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Dec 19 21:42:56 UTC 2015


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205440

            Bug ID: 205440
           Summary: lang/gcc49, lang/gcc5, devel/powerpc64-gcc on
                    powerpc64: binds a.out to /libexec/ld-elf32.so.1
                    instead of /libexec/ld-elf.so.1
           Product: Ports & Packages
           Version: Latest
          Hardware: ppc
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: bapt at FreeBSD.org
          Reporter: markmi at dsl-only.net
                CC: freebsd-ppc at FreeBSD.org
          Assignee: bapt at FreeBSD.org
                CC: freebsd-ppc at FreeBSD.org
             Flags: maintainer-feedback?(bapt at FreeBSD.org)

[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.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list