Bug 205455 - 11.0-CURRENT sys/boot/ofw/Makfile.inc , powerpc/Makefile , and uboot/Makefile.inc LDFLAGS patches for powerpc64: use -Wl, (enabled using xtoolchain based builds)
Summary: 11.0-CURRENT sys/boot/ofw/Makfile.inc , powerpc/Makefile , and uboot/Makefile...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.0-BETA1
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
Keywords: patch
Depends on:
Reported: 2015-12-20 09:05 UTC by Mark Millard
Modified: 2020-03-08 03:56 UTC (History)
1 user (show)

See Also:

svnlite diff output for sys/boot/. . . (1.18 KB, patch)
2015-12-20 09:05 UTC, Mark Millard
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Millard 2015-12-20 09:05:56 UTC
Created attachment 164411 [details]
svnlite diff output for sys/boot/. . .

[Note: I do not have a context for checking universal builds but the changes below are all in MACHINE_ARCH sections limited to powerpc64.]

Based on errors I got trying to use devel/powerpc64-gcc for buidlworld activity I suggest the following patches to the LDFLAGS handling in sys/boot/ofw/Makfile.inc , sys/boot/powerpc/Makefile , and sys/boot/uboot/Makefile.inc for powerpc64 use:
(Also as an attachment that should preserve tabs and such.)

Index: /usr/src/sys/boot/ofw/Makefile.inc
--- /usr/src/sys/boot/ofw/Makefile.inc	(revision 292413)
+++ /usr/src/sys/boot/ofw/Makefile.inc	(working copy)
@@ -2,7 +2,7 @@
 .if ${MACHINE_ARCH} == "powerpc64"
 CFLAGS+=	-m32 -mcpu=powerpc
-LDFLAGS+=	-m elf32ppc_fbsd
+LDFLAGS+=	-Wl,-m -Wl,elf32ppc_fbsd
 .include "../Makefile.inc"
Index: /usr/src/sys/boot/powerpc/Makefile.inc
--- /usr/src/sys/boot/powerpc/Makefile.inc	(revision 292413)
+++ /usr/src/sys/boot/powerpc/Makefile.inc	(working copy)
@@ -2,6 +2,7 @@
 .if ${MACHINE_ARCH} == "powerpc64"
 CFLAGS+=	-m32 -mcpu=powerpc
+LDFLAGS+=	-Wl,-m -Wl,elf32ppc_fbsd
 .include "../Makefile.inc"
Index: /usr/src/sys/boot/uboot/Makefile.inc
--- /usr/src/sys/boot/uboot/Makefile.inc	(revision 292413)
+++ /usr/src/sys/boot/uboot/Makefile.inc	(working copy)
@@ -2,7 +2,7 @@
 .if ${MACHINE_ARCH} == "powerpc64"
 CFLAGS+=	-m32 -mcpu=powerpc
-LDFLAGS+=	-m elf32ppc_fbsd
+LDFLAGS+=	-Wl,-m -Wl,elf32ppc_fbsd
 .include "../Makefile.inc"
Comment 1 Mark Millard 2016-07-11 21:19:12 UTC
As of 11.0-BETA1 (-r302457) these changes are still needed to allow building a libc++ based powerpc64 environment via devel/powerpc64-gcc (and so devel/powerpc64-xtoolchain-gcc).

Being that powerpc64 is tier 2 and devel/powerpc64-gcc is involved in what this helps: I'm not so sure that 11.0-RELEASE would pick these up but may be 11.1-RELEASE would (and 12-CURRENT before that).
Comment 2 Mark Millard 2017-01-10 10:30:37 UTC
Looks like I misclassified this as misc instead of
kernel back on 2015-Dec-20. So set it to kernel now.
Comment 3 Mark Millard 2020-03-08 03:56:02 UTC
elf32ppc_fbsd is no longer used in such Makefile.inc
files. This is based on the following grep not finding
such in a head -r358510 context:

# grep -r elf32ppc_fbsd /usr/src/* | more

(There are occurrences in other contexts.)