When MAKEOBJDIRPREFIX points to a case-insensitive file system, the

build can break when different source files create the same target
files (case-insensitivity speaking).  This is the case for object
files compiled with -fpic and shared libraries. The former uses
an extension of ".So", and the latter an extension ".so".  Rename
shared object files from *.So to *.pico to match what NetBSD does.

See also r305855

MFC after:	1 month
Sponsored by:	Bracket Computing
Differential Revision:	https://reviews.freebsd.org/D7906
This commit is contained in:
Marcel Moolenaar 2016-09-24 15:11:27 +00:00
parent d44268d135
commit 2b4da8aa20
11 changed files with 35 additions and 35 deletions

View File

@ -258,8 +258,8 @@ OBJ_GRPS += FPBIT DPBIT
.for T in ${OBJ_GRPS}
${T}_OBJS_T = ${${T}_FUNCS:S/$/.o/}
${T}_OBJS_P = ${${T}_FUNCS:S/$/.po/}
${T}_OBJS_S = ${${T}_FUNCS:S/$/.So/}
SOBJS += ${${T}_FUNCS:S/$/.So/}
${T}_OBJS_S = ${${T}_FUNCS:S/$/.pico/}
SOBJS += ${${T}_FUNCS:S/$/.pico/}
${${T}_OBJS_T}: ${${T}_CFILE} ${COMMONHDRS}
${CC_T} ${${T}_CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.ALLSRC:M*.c}
@ -274,7 +274,7 @@ ${${T}_OBJS_S}: ${${T}_CFILE} ${COMMONHDRS}
# Extra objects coming from separate files
#
.if !empty(LIB2ADD)
SOBJS += ${LIB2ADD:R:S/$/.So/}
SOBJS += ${LIB2ADD:R:S/$/.pico/}
.endif
#-----------------------------------------------------------------------
@ -298,9 +298,9 @@ ${STAT_OBJS_P}: ${STD_CFILE} ${COMMONHDRS}
.if defined(LIB1ASMSRC)
ASM_T = ${LIB1ASMFUNCS:S/$/.o/}
ASM_P = ${LIB1ASMFUNCS:S/$/.po/}
ASM_S = ${LIB1ASMFUNCS:S/$/.So/}
ASM_S = ${LIB1ASMFUNCS:S/$/.pico/}
ASM_V = ${LIB1ASMFUNCS:S/$/.vis/}
SOBJS += ${LIB1ASMFUNCS:S/$/.So/}
SOBJS += ${LIB1ASMFUNCS:S/$/.pico/}
${ASM_T}: ${LIB1ASMSRC} ${.PREFIX}.vis
${CC} -x assembler-with-cpp -c ${CFLAGS} -DL${.PREFIX} \
@ -327,7 +327,7 @@ CLEANFILES += ${ASM_V} ${ASM_V:R:S/$/.vo/}
#
EH_OBJS_T = ${LIB2ADDEHSTATIC:R:S/$/.o/}
EH_OBJS_P = ${LIB2ADDEHSTATIC:R:S/$/.po/}
EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.So/}
EH_OBJS_S = ${LIB2ADDEHSHARED:R:S/$/.pico/}
EH_CFLAGS = -fexceptions -D__GLIBC__=3 -DElfW=__ElfN
.if ${TARGET_CPUARCH} != "riscv64"
# RISCVTODO: unwinding support
@ -341,7 +341,7 @@ ${_src:R:S/$/.po/}: ${_src} ${COMMONHDRS}
${CC_P} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC}
.endfor
.for _src in ${LIB2ADDEHSHARED:M*.c}
${_src:R:S/$/.So/}: ${_src} ${COMMONHDRS}
${_src:R:S/$/.pico/}: ${_src} ${COMMONHDRS}
${CC_S} ${EH_CFLAGS} -o ${.TARGET} ${.IMPSRC}
.endfor

View File

@ -35,7 +35,7 @@ SYMS = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta \
OBJS= ${SYMS:S/$/.o/}
OBJS_T= ${SYMS:S/$/.o/}
OBJS_P= ${SYMS:S/$/.po/}
OBJS_S= ${SYMS:S/$/.So/}
OBJS_S= ${SYMS:S/$/.pico/}
#-----------------------------------------------------------------------
#

View File

@ -76,7 +76,7 @@ historyn.c: makelist Makefile
sh ${.CURDIR}/makelist -n history.c > ${.TARGET}
# minimal dependency to make "make depend" optional
editline.o editline.po editline.So editline.ln: \
editline.o editline.po editline.pico editline.ln: \
common.h emacs.h fcns.c fcns.h help.c help.h vi.h
tc1.o: ${.CURDIR}/TEST/tc1.c

View File

@ -58,13 +58,13 @@ MLINKS+=libprocstat.3 procstat_close.3 \
.if ${MK_CDDL} != "no"
CFLAGS+= -DLIBPROCSTAT_ZFS
OBJS+= zfs/zfs.o
SOBJS+= zfs/zfs.So
SOBJS+= zfs/zfs.pico
POBJS+= zfs/zfs.po
SUBDIR= zfs
zfs/zfs.o: .PHONY
@cd ${.CURDIR}/zfs && ${MAKE} zfs.o
zfs/zfs.So: .PHONY
@cd ${.CURDIR}/zfs && ${MAKE} zfs.So
zfs/zfs.pico: .PHONY
@cd ${.CURDIR}/zfs && ${MAKE} zfs.pico
zfs/zfs.po: .PHONY
@cd ${.CURDIR}/zfs && ${MAKE} zfs.po
.endif

View File

@ -15,15 +15,15 @@ CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_CPUARCH}
SYSCALLS= thr_new
SYSCALL_SRC= ${SYSCALLS:S/$/.S/}
SYSCALL_OBJ= ${SYSCALLS:S/$/.So/}
SYSCALL_OBJ= ${SYSCALLS:S/$/.pico/}
${SYSCALL_SRC}:
printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' > ${.TARGET}
LIBC_OBJS=
SOBJS+= thr_libc.So
SOBJS+= thr_libc.pico
CLEANFILES+= ${SYSCALL_SRC} ${SYSCALL_OBJ} ${LIBC_OBJS}
thr_libc.So: ${SYSCALL_OBJ} ${LIBC_OBJS}
thr_libc.pico: ${SYSCALL_OBJ} ${LIBC_OBJS}
${CC} -fPIC -nostdlib -o ${.TARGET} -r ${.ALLSRC}

View File

@ -152,8 +152,8 @@ ${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//}
@rm -f ${.TARGET}
${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
.if defined(LIB)
CLEANFILES+= ${_D}.So ${_D}.po
${_D}.So: ${_DSRC} ${SOBJS:S/^${_D}.So$//}
CLEANFILES+= ${_D}.pico ${_D}.po
${_D}.pico: ${_DSRC} ${SOBJS:S/^${_D}.pico$//}
@rm -f ${.TARGET}
${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h}
${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//}

View File

@ -77,9 +77,9 @@ CTFFLAGS+= -g
.include <bsd.libnames.mk>
# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
# .So used for PIC object files
# .pico used for PIC object files
.SUFFIXES:
.SUFFIXES: .out .o .po .So .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln
.SUFFIXES: .out .o .po .pico .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln
.if !defined(PICFLAG)
.if ${MACHINE_CPUARCH} == "sparc64"
@ -99,7 +99,7 @@ PO_FLAG=-pg
${CC} ${PO_FLAG} ${STATIC_CFLAGS} ${PO_CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}
.c.So:
.c.pico:
${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}
@ -109,18 +109,18 @@ PO_FLAG=-pg
.cc.po .C.po .cpp.po .cxx.po:
${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
.cc.So .C.So .cpp.So .cxx.So:
.cc.pico .C.pico .cpp.pico .cxx.pico:
${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
.f.po:
${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
${CTFCONVERT_CMD}
.f.So:
.f.pico:
${FC} ${PICFLAG} -DPIC ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
${CTFCONVERT_CMD}
.s.po .s.So:
.s.po .s.pico:
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
${CTFCONVERT_CMD}
@ -129,7 +129,7 @@ PO_FLAG=-pg
${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}
.asm.So:
.asm.pico:
${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \
${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}
@ -139,7 +139,7 @@ PO_FLAG=-pg
-o ${.TARGET}
${CTFCONVERT_CMD}
.S.So:
.S.pico:
${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \
-c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}
@ -207,7 +207,7 @@ lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS}
.if defined(SHLIB_NAME) || \
defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
SOBJS+= ${OBJS:.o=.So}
SOBJS+= ${OBJS:.o=.pico}
DEPENDOBJS+= ${SOBJS}
CLEANFILES+= ${SOBJS}
.endif
@ -430,7 +430,7 @@ OBJS_DEPEND_GUESS.${_S:R}.po+= ${_S}
.if defined(SHLIB_NAME) || \
defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
.for _S in ${SRCS:N*.[hly]}
OBJS_DEPEND_GUESS.${_S:R}.So+= ${_S}
OBJS_DEPEND_GUESS.${_S:R}.pico+= ${_S}
.endfor
.endif

View File

@ -23,7 +23,7 @@ __${_this}__: .NOTMAIN
.if defined(SRCS)
# it would be nice to be able to query .SUFFIXES
OBJ_EXTENSIONS+= .o .po .lo .So
OBJ_EXTENSIONS+= .o .po .lo .pico
# explicit dependencies help short-circuit .SUFFIX searches
SRCS_DEP_FILTER+= N*.[hly]
@ -179,7 +179,7 @@ DEPEND_SUFFIXES += .c .h .cpp .hpp .cxx .hxx .cc .hh
@case "${.MAKE.META.FILES:T:M*.po.*}" in \
*.po.*) mv $@.${.MAKE.PID} $@;; \
*) { cat $@.${.MAKE.PID}; \
sed 's,\.So:,.o:,;s,\.o:,.po:,' $@.${.MAKE.PID}; } | sort -u > $@; \
sed 's,\.pico:,.o:,;s,\.o:,.po:,' $@.${.MAKE.PID}; } | sort -u > $@; \
rm -f $@.${.MAKE.PID};; \
esac
.else
@ -244,7 +244,7 @@ META_FILES = *.meta
.elif ${OPTIMIZE_OBJECT_META_FILES:Uno:tl} == "no"
META_FILES = ${.MAKE.META.FILES:T:N.depend*:O:u}
.else
# if we have 1000's of .o.meta, .So.meta etc we need only look at one set
# if we have 1000's of .o.meta, .pico.meta etc we need only look at one set
# it is left as an exercise for the reader to work out what this does
META_FILES = ${.MAKE.META.FILES:T:N.depend*:N*o.meta:O:u} \
${.MAKE.META.FILES:T:M*.${.MAKE.META.FILES:M*o.meta:R:E:O:u:[1]}.meta:O:u}

View File

@ -165,7 +165,7 @@ ${mfile:T:S/.m$/.h/}: ${mfile}
.endfor
kernel-clean:
rm -f *.o *.so *.So *.ko *.s eddep errs \
rm -f *.o *.so *.pico *.ko *.s eddep errs \
${FULLKERNEL} ${KERNEL_KO} ${KERNEL_KO}.debug \
linterrs tags vers.c \
vnode_if.c vnode_if.h vnode_if_newproto.h vnode_if_typedef.h \
@ -180,9 +180,9 @@ lint: ${LNFILES}
# dynamic references. We could probably do a '-Bforcedynamic' mode like
# in the a.out ld. For now, this works.
HACK_EXTRA_FLAGS?= -shared
hack.So: Makefile
hack.pico: Makefile
:> hack.c
${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.So
${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.pico
rm -f hack.c
assym.s: $S/kern/genassym.sh genassym.o

View File

@ -176,7 +176,7 @@ SYSTEM_CFILES= config.c env.c hints.c vnode_if.c
SYSTEM_DEP= Makefile ${SYSTEM_OBJS}
SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS}
SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o}
SYSTEM_OBJS+= hack.So
SYSTEM_OBJS+= hack.pico
MD_ROOT_SIZE_CONFIGURED!= grep MD_ROOT_SIZE opt_md.h || true ; echo
.if ${MFS_IMAGE:Uno} != "no"

View File

@ -73,7 +73,7 @@ LIBADD= kvm devinfo m geom memstat
.include <bsd.snmpmod.mk>
printcap.So: printcap.c
printcap.pico: printcap.c
${CC} ${PICFLAG} -DPIC ${CFLAGS:C/^-W.*//} -c ${.IMPSRC} -o ${.TARGET}
smilint: