NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/53238: MKREPRO builds use reproducible build flags building tools



>Number:         53238
>Category:       toolchain
>Synopsis:       MKREPRO builds use reproducible build flags building tools
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 30 18:20:00 +0000 2018
>Originator:     Robert Elz
>Release:        NetBSD 8.99.14
>Organization:
>Environment:
	
	
System: NetBSD jinx.noi.kre.to 8.99.14 NetBSD 8.99.14 (GENERIC) #3: Fri Apr 13 15:19:55 ICT 2018 kre%onyx.coe.psu.ac.th@localhost:/usr/obj/testing/amd64/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	If doing a build (build.sh) with -P (MKREPRO) on a host that
	does not have the CC command line flags that are needed for
	reproducible builds, the build fails.

>How-To-Repeat:

	Use a NetBSD-6 vintage build host (or anything else with
	a dated gcc), and attempt to run build.sh -P

	Expect to see something like:

dependall ===> tools/makekeys
/usr/obj/8/tools/bin/nbsed -e 's/#undef NARROWPROTO/#define NARROWPROTO/'   -e '
s/#undef FUNCPROTO/#define FUNCPROTO 15/'  < /release/8/src/xsrc/external/mit/xp
roto/dist/Xfuncproto.h.in > Xfuncproto.h
#    create  makekeys/makekeys.d
/usr/obj/8/tools/bin/nbhost-mkdep -f makekeys.d.tmp  --      -I/usr/obj/8/tools/
include/compat -I/release/8/src/tools/compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OF
FSET_BITS=64 -I. -Wp,-fno-canonical-system-headers -DCSRG_BASED -DFUNCPROTO=15 -
DNARROWPROTO -I/release/8/amd64/usr/X11R7/include -D__AMD64__     /release/8/src
/xsrc/external/mit/libX11/dist/src/util/makekeys.c &&  mv makekeys.d.tmp makekey
s.d
#    create  makekeys/.depend
rm -f .depend
/usr/obj/8/tools/bin/nbhost-mkdep -s .lo\ .ln\ .d -d -f .depend makekeys.d
#   compile  makekeys/makekeys.lo
cc -O -I/usr/obj/8/tools/include/compat -I/release/8/src/tools/compat -DHAVE_NBT
OOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -I. -Wp,-fno-canonical-system-headers -DCS
RG_BASED -DFUNCPROTO=15 -DNARROWPROTO -I/release/8/amd64/usr/X11R7/include -D__A
MD64__ -c -o makekeys.lo.o    /release/8/src/xsrc/external/mit/libX11/dist/src/u
til/makekeys.c
cc1: error: unrecognized command line option "-fno-canonical-system-headers"

*** Failed target:  makekeys.lo

	There's no useful point building tools in a MKREPRO way

	The cause of this seems to be (in bsd.sys.mk)

.if ${MKREPRO:Uno} == "yes" && ${MKLLVM:Uno} != "yes"
.export NETBSDSRCDIR DESTDIR X11SRCDIR

.if !empty(DESTDIR)
CPPFLAGS+=      -Wp,-iremap,${DESTDIR}:
REPROFLAGS+=    -fdebug-prefix-map=\$$DESTDIR=
.endif  
     
CPPFLAGS+=      -Wp,-fno-canonical-system-headers
CPPFLAGS+=      -Wp,-iremap,${NETBSDSRCDIR}:/usr/src
CPPFLAGS+=      -Wp,-iremap,${X11SRCDIR}:/usr/xsrc
REPROFLAGS+=    -fdebug-prefix-map=\$$NETBSDSRCDIR=/usr/src
REPROFLAGS+=    -fdebug-prefix-map=\$$X11SRCDIR=/usr/xsrc
LINTFLAGS+=     -R${NETBSDSRCDIR}=/usr/src -R${X11SRCDIR}=/usr/xsrc

REPROFLAGS+=    -fdebug-regex-map='/usr/src/(.*)/obj.*=/usr/obj/\1'
REPROFLAGS+=    -fdebug-regex-map='/usr/src/(.*)/obj.*/(.*)=/usr/obj/\1/\2'

CFLAGS+=        ${REPROFLAGS}
CXXFLAGS+=      ${REPROFLAGS}
.endif

>Fix:
	Probably turn all of that off when building tools.

	NB: This affects NetBSD-8 builds, so needs a quick fix & pullup



Home | Main Index | Thread Index | Old Index