[Bug 227920] [PATCH] fix for Makefile.libcompat to use external cross-compiler

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat May 19 23:04:08 UTC 2018


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

--- Comment #12 from Mark Millard <marklmi26-fbsd at yahoo.com> ---
(In reply to Kenneth Salerno from comment #5)

Summary of a failure:

When a clang-based environment tries to build a target
by building gcc 4.2.1 as the boottrap compiler, it looks
like LIB32CFLAGS ends up being used on the bootstrap
compiler's cpp line: it ends up being rejected by the
gcc 4.2.1 related cpp.

More detailed evidence:

I tried to cross build amd64 -> powerpc64 where the
cross build built gcc 4.2.1 to do the later build stages.
I used the Makefile.libcompat patch variant below:

# svnlite diff /usr/src/Makefile.libcompat
Index: /usr/src/Makefile.libcompat
===================================================================
--- /usr/src/Makefile.libcompat (revision 333863)
+++ /usr/src/Makefile.libcompat (working copy)
@@ -63,6 +63,14 @@


 LIB32CFLAGS=   -DCOMPAT_32BIT
+.if ${TARGET_ARCH} == "powerpc64"
+# TARGET happens to have the right 32-bit name to use in -target
+# clang uses -target to figure out which assembler notation to
+# process.
+.if ${TARGET} != ${MACHINE} && ${X_COMPILER_TYPE} == "clang"
+LIB32CFLAGS+=  -target ${TARGET}-unknown-freebsd12.0
+.endif
+.endif
 LIB32DTRACE=   ${DTRACE} -32
 LIB32WMAKEFLAGS+=      -DCOMPAT_32BIT


This appears to contribute to /usr/src/include/rpc/Makefile 's:

RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C

and ends up feeding the relevant cpp a -target, which is then
rejected:

===> include/rpc (includes)
Building
/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/include/rpc/rpcb_prot.h
--- rpcb_prot.h ---
cpp: powerpc-unknown-freebsd12.0: No such file or directory
cpp: warning: '-x c' after last input file has no effect
cpp: unrecognized option '-target'
cpp: No input files specified
--- includes_subdir_include/rpcsvc ---
Building
/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/include/rpcsvc/rstat.h
Building
/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/include/rpcsvc/rwall.h
Building
/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/include/rpcsvc/sm_inter.h
Building
/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/include/rpcsvc/spray.h
Building
/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/include/rpcsvc/yppasswd.h
Building
/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/include/rpcsvc/yp.h
Building
/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/include/rpcsvc/ypxfrd.h
--- includes_subdir_include/rpc ---
*** [rpcb_prot.h] Error code 1

make[3]: stopped in /usr/src/include/rpc
.ERROR_TARGET='rpcb_prot.h'
.ERROR_META_FILE='/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/include/rpc/rpcb_prot.h.meta'
.MAKE.LEVEL='3'
MAKEFILE=''
.MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes verbose'
_ERROR_CMD='RPCGEN_CPP=cpp\ -DCOMPAT_32BIT\ -target\
powerpc-unknown-freebsd12.0\ -mcpu=powerpc\ -m32\ \
-L/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/tmp/usr/lib32\
\
--sysroot=/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/tmp\
\
-B/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/tmp/usr/bin\
-B/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/tmp/usr/lib32\
-isystem\
/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/tmp/usr/include
rpcgen -C -h -DWANT_NFS3 /usr/src/include/rpc/rpcb_prot.x -o rpcb_prot.h;'
.CURDIR='/usr/src/include/rpc'
.MAKE='make'
.OBJDIR='/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/include/rpc'
.TARGETS='includes'
DESTDIR='/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32/tmp'
LD_LIBRARY_PATH=''
MACHINE='powerpc'
MACHINE_ARCH='powerpc'
MAKEOBJDIRPREFIX=''
MAKESYSPATH='/usr/src/share/mk'
MAKE_VERSION='20180512'
PATH='/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/tmp/legacy/usr/sbin:/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/tmp/legacy/usr/bin:/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/tmp/legacy/bin:/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/tmp/usr/sbin:/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin'
SRCTOP='/usr/src'
OBJTOP='/usr/obj/powerpc64vtsc_clang_gcc421/powerpc.powerpc64/usr/src/powerpc.powerpc64/obj-lib32'
.MAKE.MAKEFILES='/usr/src/share/mk/sys.mk /usr/src/share/mk/local.sys.env.mk
/usr/src/share/mk/src.sys.env.mk
/root/src.configs/src.conf.powerpc64-gcc421-bootstrap-clang.amd64-host
/usr/src/share/mk/bsd.mkopt.mk /usr/src/share/mk/src.sys.obj.mk
/usr/src/share/mk/auto.obj.mk /usr/src/share/mk/bsd.suffixes.mk
/usr/src/share/mk/local.sys.mk /usr/src/share/mk/src.sys.mk /dev/null
/usr/src/include/rpc/Makefile /usr/src/share/mk/bsd.prog.mk
/usr/src/share/mk/bsd.init.mk /usr/src/share/mk/bsd.opts.mk
/usr/src/share/mk/bsd.cpu.mk /usr/src/share/mk/local.init.mk
/usr/src/share/mk/src.init.mk /usr/src/share/mk/bsd.own.mk
/usr/src/share/mk/bsd.compiler.mk /usr/src/share/mk/bsd.linker.mk
/usr/src/share/mk/bsd.libnames.mk /usr/src/share/mk/src.libnames.mk
/usr/src/share/mk/src.opts.mk /usr/src/share/mk/bsd.nls.mk
/usr/src/share/mk/bsd.confs.mk /usr/src/share/mk/bsd.files.mk
/usr/src/share/mk/bsd.incs.mk /usr/src/share/mk/bsd.links.mk
/usr/src/share/mk/bsd.dep.mk /usr/src/share/mk/bsd.clang-analyze.mk
/usr/src/share/mk/bsd.obj.mk /usr/src/share/mk/bsd.subdir.mk
/usr/src/share/mk/bsd.sys.mk'
.PATH='. /usr/src/include/rpc'
1 error
-

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


More information about the freebsd-bugs mailing list