mirror of
https://github.com/opnsense/src.git
synced 2026-04-22 06:39:32 -04:00
Obviate the need to set the COMPILER_PATH and LIBRARY_PATH in Makefile.inc1
to pick up the correct cross-tools (the compiler executables and binutils)
and special linker files (crt*.o). This is now controlled by a single knob,
TOOLS_PREFIX, when building cross-tools.
Fixed regression in Makefile.inc1,v 1.203 (-nostdinc). This clobbered target
architecture's CFLAGS with building host's CPUTYPE setting in /etc/make.conf,
and had a nice but nasty side effect of exposing some (normally hidden) bugs
in system headers.
(Attempt to move the "-nostdinc -I..." part of CFLAGS into the new CINCLUDES
(modeled after a similar CXXINCLUDES) eventually failed because hard-coding
${WORLDTMP}/usr/include to be the first in the include list does not always
work, e.g. lib/libbind.)
Compensate the -nostdinc removal by making cpp(1) built in the cross-tools
stage to not look for <> header files in the building host's /usr/include
(already committed as gnu/usr.bin/cc/cc_tools/freebsd-native.h, revisions
1.10-1.12, STANDARD_INCLUDE_DIR).
: $ /usr/obj/usr/src/i386/usr/bin/cpp -v /dev/null
:
: Before:
:
: #include <...> search starts here:
: /usr/obj/usr/src/i386/usr/include
: /usr/include
: End of search list.
:
: After:
:
: #include <...> search starts here:
: /usr/obj/usr/src/i386/usr/include
: /usr/obj/usr/src/i386/usr/include
(Disabling the use of GCC_INCLUDE_DIR in the FREEBSD_NATIVE case would fix
the duplicate above.)
Get rid of the (now unneeded) -I${DESTDIR}/usr/include magic in bsd.prog.mk
and bsd.lib.mk. Finish the removal of LDDESTDIR in bsd.lib.mk,v 1.55 -- we
no longer have users of it.
The required changes to gcc were already committed as contrib/gcc.295/gcc.c,
revisions 1.23 and 1.24.
Basically, this allows for the changes above plus makes gcc(1) persistent
about path configuration, whether it's configured as a native or a cross
compiler:
: $ /usr/obj/usr/src/i386/usr/bin/cc -print-search-dirs
: install: /usr/obj/usr/src/i386/usr/libexec/(null)
: programs: /usr/obj/usr/src/i386/usr/libexec/elf/:/usr/obj/usr/src/i386/usr/libexec/
: libraries: /usr/obj/usr/src/i386/usr/lib/
:
: $ /usr/obj/alpha/usr/src/i386/usr/bin/cc -print-search-dirs
: install: /usr/obj/alpha/usr/src/i386/usr/libexec/(null)
: programs: /usr/obj/alpha/usr/src/i386/usr/libexec/elf/:/usr/obj/alpha/usr/src/i386/usr/libexec/
: libraries: /usr/obj/alpha/usr/src/i386/usr/lib/
Reviewed by: bde, obrien
This commit is contained in:
parent
4cd016e8fd
commit
ea5c0da93b
3 changed files with 5 additions and 22 deletions
|
|
@ -167,11 +167,7 @@ INSTALLTMP!= /usr/bin/mktemp -d -u -t install
|
|||
CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
|
||||
MACHINE_ARCH=${TARGET_ARCH} \
|
||||
MACHINE=${TARGET} \
|
||||
COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
|
||||
LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib \
|
||||
OBJFORMAT_PATH=${WORLDTMP}/usr/libexec \
|
||||
CFLAGS="-nostdinc ${CFLAGS}" \
|
||||
CXXINCLUDES="-nostdinc++ ${CXXINCLUDES}" \
|
||||
PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.6.0 \
|
||||
GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
|
||||
GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
|
||||
|
|
|
|||
|
|
@ -37,11 +37,6 @@ SHLIB_NAME?= lib${LIB}.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
|
|||
.endif
|
||||
.endif
|
||||
|
||||
.if defined(DESTDIR) && !defined(BOOTSTRAPPING)
|
||||
CFLAGS+= -I${DESTDIR}/usr/include
|
||||
CXXINCLUDES+= -I${DESTDIR}/usr/include/g++
|
||||
.endif
|
||||
|
||||
.if defined(DEBUG_FLAGS)
|
||||
CFLAGS+= ${DEBUG_FLAGS}
|
||||
.endif
|
||||
|
|
@ -196,10 +191,6 @@ lib${LIB}_p.a:: ${POBJS}
|
|||
${RANLIB} lib${LIB}_p.a
|
||||
.endif
|
||||
|
||||
.if defined(DESTDIR) && !defined(BOOTSTRAPPING)
|
||||
LDDESTDIRENV?= LIBRARY_PATH=${DESTDIR}${SHLIBDIR}:${DESTDIR}${LIBDIR}
|
||||
.endif
|
||||
|
||||
SOBJS+= ${OBJS:.o=.So}
|
||||
|
||||
.if defined(SHLIB_NAME)
|
||||
|
|
@ -210,13 +201,13 @@ ${SHLIB_NAME}: ${SOBJS}
|
|||
@ln -sf ${SHLIB_NAME} ${SHLIB_LINK}
|
||||
.endif
|
||||
.if ${OBJFORMAT} == aout
|
||||
@${LDDESTDIRENV} ${CC} -shared -Wl,-x,-assert,pure-text \
|
||||
@${CC} -shared -Wl,-x,-assert,pure-text \
|
||||
-o ${SHLIB_NAME} \
|
||||
`lorder ${SOBJS} | tsort -q` ${LDDESTDIR} ${LDADD}
|
||||
`lorder ${SOBJS} | tsort -q` ${LDADD}
|
||||
.else
|
||||
@${LDDESTDIRENV} ${CC} -shared -Wl,-x \
|
||||
@${CC} -shared -Wl,-x \
|
||||
-o ${SHLIB_NAME} -Wl,-soname,${SONAME} \
|
||||
`lorder ${SOBJS} | tsort -q` ${LDDESTDIR} ${LDADD}
|
||||
`lorder ${SOBJS} | tsort -q` ${LDADD}
|
||||
.endif
|
||||
.endif
|
||||
|
||||
|
|
@ -252,7 +243,7 @@ _EXTRADEPEND:
|
|||
.if !defined(NOEXTRADEPEND) && defined(SHLIB_NAME)
|
||||
.if ${OBJFORMAT} == aout
|
||||
echo ${SHLIB_NAME}: \
|
||||
`${LDDESTDIRENV} ${CC} -shared -Wl,-f ${LDDESTDIR} ${LDADD}` \
|
||||
`${CC} -shared -Wl,-f ${LDADD}` \
|
||||
>> ${DEPENDFILE}
|
||||
.else
|
||||
.if defined(DPADD) && !empty(DPADD)
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ __initialized__:
|
|||
.SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .s .S
|
||||
|
||||
CFLAGS+=${COPTS} ${DEBUG_FLAGS}
|
||||
.if defined(DESTDIR) && !defined(BOOTSTRAPPING)
|
||||
CFLAGS+= -I${DESTDIR}/usr/include
|
||||
CXXINCLUDES+= -I${DESTDIR}/usr/include/g++
|
||||
.endif
|
||||
|
||||
.if !defined(DEBUG_FLAGS)
|
||||
STRIP?= -s
|
||||
|
|
|
|||
Loading…
Reference in a new issue