[Bug 215947] head -r311147 (e.g.): gcc 4.2.1 requires -mlongcall but clang does not need it (and various versions do not have it)
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Tue Jan 10 20:00:35 UTC 2017
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=215947
Bug ID: 215947
Summary: head -r311147 (e.g.): gcc 4.2.1 requires -mlongcall
but clang does not need it (and various versions do
not have it)
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: kern
Assignee: freebsd-bugs at FreeBSD.org
Reporter: markmi at dsl-only.net
[I attempt builds of libc++ based FreeBSD for powerpc64 and powerpc
under both system-clang and devel/powerpc64-gcc (xtoolchain).]
I in order to avoid builds stopping I've historically used patches
like:
Index: /usr/src/lib/csu/powerpc64/Makefile
===================================================================
--- /usr/src/lib/csu/powerpc64/Makefile (revision 311147)
+++ /usr/src/lib/csu/powerpc64/Makefile (working copy)
@@ -5,19 +5,20 @@
SRCS= crt1.c crti.S crtn.S
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
OBJS+= Scrt1.o gcrt1.o
+.include <bsd.compiler.mk>
+.if ${COMPILER_TYPE} == "gcc"
CFLAGS+= -I${.CURDIR}/../common \
-I${.CURDIR}/../../libc/include \
-mlongcall
+.else
+CFLAGS+= -I${.CURDIR}/../common \
+ -I${.CURDIR}/../../libc/include
+.endif
# XXX: See the log for r232932 as to why the above -mlongcall is needed.
Since
# clang doesn't support -mlongcall, and testing shows a clang linked with a
# clang-built csu segfaults, this must currently be compiled with gcc. Once
# clang supports -mlongcall, or we get a fixed ld, this can be revisited.
-.include <bsd.compiler.mk>
-.if ${COMPILER_TYPE} != "gcc"
-CC:= gcc
-COMPILER_TYPE:= gcc
-.endif
FILES= ${OBJS}
FILESMODE= ${LIBMODE}
Index: /usr/src/sys/conf/kmod.mk
===================================================================
--- /usr/src/sys/conf/kmod.mk (revision 311147)
+++ /usr/src/sys/conf/kmod.mk (working copy)
@@ -147,8 +147,12 @@
.endif
.if ${MACHINE_CPUARCH} == powerpc
+.if ${COMPILER_TYPE} == "gcc"
CFLAGS+= -mlongcall -fno-omit-frame-pointer
+.else
+CFLAGS+= -fno-omit-frame-pointer
.endif
+.endif
.if ${MACHINE_CPUARCH} == mips
CFLAGS+= -G0 -fno-pic -mno-abicalls -mlong-calls
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list