Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Dec 2015 21:42:55 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [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
Message-ID:  <bug-205440-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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@FreeBSD.org
          Reporter: markmi@dsl-only.net
                CC: freebsd-ppc@FreeBSD.org
          Assignee: bapt@FreeBSD.org
                CC: freebsd-ppc@FreeBSD.org
             Flags: maintainer-feedback?(bapt@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-205440-13>