Changeset View
Standalone View
share/mk/bsd.compat.mk
Show All 34 Lines | |||||
.elif ${COMPAT_ARCH} == "powerpc64" | .elif ${COMPAT_ARCH} == "powerpc64" | ||||
HAS_COMPAT=32 | HAS_COMPAT=32 | ||||
.if empty(COMPAT_CPUTYPE) | .if empty(COMPAT_CPUTYPE) | ||||
LIB32CPUFLAGS= -mcpu=powerpc | LIB32CPUFLAGS= -mcpu=powerpc | ||||
.else | .else | ||||
LIB32CPUFLAGS= -mcpu=${COMPAT_CPUTYPE} | LIB32CPUFLAGS= -mcpu=${COMPAT_CPUTYPE} | ||||
.endif | .endif | ||||
imp: Shouldn't this just be
.if ${COMPAT_COMPILER_TYPE} == "gcc"
| |||||
# Determines linker used for 32-bit compatibility | |||||
# Currently LLD support for PowerPC 32-bit is not complete, | |||||
# so falling back to ld.bfd | |||||
# native build | |||||
_LIB32LD_NATIVE=/usr/bin/ld.bfd | |||||
# cross | |||||
_LIB32LD_CROSS=${WORLDTMP}/usr/bin/ld.bfd | |||||
# cross with toolchain file | |||||
_LIB32LD_CROSS_FILE=${LOCALBASE}/bin/${CROSS_BINUTILS_PREFIX}-ld.bfd | |||||
.if ${_HOST_ARCH} == "powerpc64" | |||||
LIB32LD= ${_LIB32LD_NATIVE} | |||||
Done Inline Actionsthis hard wires the *HOSTS* current /usr/bin/ld.bfd. That's not right. It should be the one in the sysroot, even for native builds. imp: this hard wires the *HOSTS* current /usr/bin/ld.bfd. That's not right. It should be the one in… | |||||
.elif defined(TARGET_ARCH) && "${LINKER_TYPE}" == "lld" | |||||
impUnsubmitted Done Inline ActionsPlease don't use TARGET_ARCH. It's incorrect here since this is included from both Makefile.inc1 and from individual makefiles. Instead, please follow the (new) convention of the rest of the file and use COMPAT_ARCH since it does the proper dance. imp: Please don't use TARGET_ARCH. It's incorrect here since this is included from both Makefile. | |||||
Done Inline Actionswe know COMPAT_ARCH is defined here, and that it necessarily equals powerpc64. imp: we know COMPAT_ARCH is defined here, and that it necessarily equals powerpc64. | |||||
.if ${TARGET_ARCH} == "powerpc64" && defined(CROSS_TOOLCHAIN) | |||||
Done Inline Actionswe know 100% that COMPAT_ARCH is powerpc64 here, maybe you have a nesting issue? imp: we know 100% that COMPAT_ARCH is powerpc64 here, maybe you have a nesting issue? | |||||
.if !defined(CROSS_BINUTILS_PREFIX) | |||||
.error 32 bit binaries on PowerPC64 requires binutils linker ld.bfd. Please set CROSS_BINUTILS_PREFIX. | |||||
.endif | |||||
LIB32LD= ${_LIB32LD_CROSS_FILE} | |||||
.else | |||||
LIB32LD= ${_LIB32LD_CROSS} | |||||
.endif | |||||
.endif | |||||
# for other unhandled cases just use the main linker | |||||
# cross building | |||||
.if defined(XLD) | |||||
LIB32LD?=${XLD} | |||||
.else | |||||
LIB32LD?=${LD} | |||||
.endif | |||||
.if (defined(WANT_COMPILER_TYPE) && ${WANT_COMPILER_TYPE} == gcc) || \ | |||||
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) | |||||
LIB32CPUFLAGS+= -m32 | LIB32CPUFLAGS+= -m32 | ||||
.else | |||||
LIB32CPUFLAGS+= -target powerpc-unknown-freebsd13.0 | |||||
.if ${LIB32LD} == "ld.bfd" | |||||
Done Inline ActionsI'm having trouble seeing when this would be true given the full paths. imp: I'm having trouble seeing when this would be true given the full paths.
And full paths, btw… | |||||
Done Inline ActionsHere -fuse-ld will be used when *not* using GCC. Clang implemented full paths after https://reviews.llvm.org/D17952. alfredo: Here -fuse-ld will be used when *not* using GCC. Clang implemented full paths after https… | |||||
LIB32CPUFLAGS+= -fuse-ld=bfd | |||||
.else | |||||
LIB32CPUFLAGS+= -fuse-ld=${LIB32LD} | |||||
.endif | |||||
.endif | |||||
LIB32_MACHINE= powerpc | LIB32_MACHINE= powerpc | ||||
LIB32_MACHINE_ARCH= powerpc | LIB32_MACHINE_ARCH= powerpc | ||||
LIB32WMAKEFLAGS= \ | LIB32WMAKEFLAGS= \ | ||||
LD="${XLD} -m elf32ppc_fbsd" | LD="${LIB32LD} -m elf32ppc_fbsd" | ||||
.elif ${COMPAT_ARCH:Mmips64*} != "" | .elif ${COMPAT_ARCH:Mmips64*} != "" | ||||
HAS_COMPAT=32 | HAS_COMPAT=32 | ||||
.if (defined(WANT_COMPILER_TYPE) && ${WANT_COMPILER_TYPE} == gcc) || \ | .if (defined(WANT_COMPILER_TYPE) && ${WANT_COMPILER_TYPE} == gcc) || \ | ||||
(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) | (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) | ||||
.if empty(COMPAT_CPUTYPE) | .if empty(COMPAT_CPUTYPE) | ||||
LIB32CPUFLAGS= -march=mips3 | LIB32CPUFLAGS= -march=mips3 | ||||
.else | .else | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |
Shouldn't this just be
.if ${COMPAT_COMPILER_TYPE} == "gcc"