Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 2014 20:02:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-arm@FreeBSD.org
Subject:   [Bug 175605] devel/binutils: please fix build binutils-2.23.1 in raspberry pi
Message-ID:  <bug-175605-7-9mj5B56TBE@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-175605-7@https.bugs.freebsd.org/bugzilla/>
References:  <bug-175605-7@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=175605

Andreas Tobler <andreast@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andreast@FreeBSD.org

--- Comment #7 from Andreas Tobler <andreast@FreeBSD.org> ---
To get the right linker command do this:
(the -v is for verbose)

andreast@wandquad:~ % cc -o z  z.c -v
Using built-in specs.
Target: armv6-undermydesk-freebsd
Configured with: FreeBSD/armv6 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]
 /usr/libexec/cc1 -quiet -v -D_LONGLONG z.c -quiet -dumpbase z.c -auxbase z
-version -o /tmp//ccMJ520s.s
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/gcc/4.2
 /usr/include
End of search list.
GNU C version 4.2.1 20070831 patched [FreeBSD] (armv6-undermydesk-freebsd)
    compiled by GNU C version 4.2.1 20070831 patched [FreeBSD].
GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=130664
Compiler executable checksum: 20743f84b7aef1f094db166caa2fbdf7
 /usr/bin/as -mfpu=softvfp -meabi=4 -o /tmp//ccNNWzRe.o /tmp//ccMJ520s.s
 /usr/bin/ld --eh-frame-hdr -V -dynamic-linker /libexec/ld-elf.so.1
--hash-style=both --enable-new-dtags -X -o z /usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/crtbegin.o -L/usr/lib -L/usr/lib /tmp//ccNNWzRe.o -lgcc --as-needed
-lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/crtend.o /usr/lib/crtn.o
GNU ld 2.17.50 [FreeBSD] 2007-07-03
  Supported emulations:
   armelf_fbsd


-->>

Then build only the z.o:

andreast@wandquad:~ % cc -c z.c -v
Using built-in specs.
Target: armv6-undermydesk-freebsd
Configured with: FreeBSD/armv6 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]
 /usr/libexec/cc1 -quiet -v -D_LONGLONG z.c -quiet -dumpbase z.c -auxbase z
-version -o /tmp//ccoqB09j.s
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/gcc/4.2
 /usr/include
End of search list.
GNU C version 4.2.1 20070831 patched [FreeBSD] (armv6-undermydesk-freebsd)
    compiled by GNU C version 4.2.1 20070831 patched [FreeBSD].
GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=130664
Compiler executable checksum: 20743f84b7aef1f094db166caa2fbdf7
 /usr/bin/as -mfpu=softvfp -meabi=4 -o z.o /tmp//ccoqB09j.s

-->

And last, link the z.o to z:

andreast@wandquad:~ % /build/gdb/testbin_armv6/bin/ld -V -Bstatic -X -o z
/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbeginT.o -L/usr/lib z.o -lgcc
-lgcc_eh -lc -lgcc -lgcc_eh /usr/lib/crtend.o /usr/lib/crtn.o
GNU ld (GNU Binutils) 2.24.51.20140706
  Supported emulations:
   armelf_fbsd
   armelfb_fbsd
   armelf
andreast@wandquad:~ % ./z 
mumu


Doesn't matter if static or dynamic, at least for me. And I'm on current.

-- 
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-175605-7-9mj5B56TBE>