share/mk: pass SHARED_CFLAGS to PIC and PIE from assembly
This matches what we do with C sources. Document SHARED_CFLAGS. PR: 286975 Reviewed by: jhb, emaste Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D50466
This commit is contained in:
@@ -197,6 +197,9 @@ LIBADD Additional libraries. This is for base system libraries
|
||||
LIBADD.${.TARGET:T}
|
||||
Libraries dependent on output file name.
|
||||
|
||||
SHARED_CFLAGS Additional compiler flags used when creating shared or
|
||||
position independent object files.
|
||||
|
||||
COMPILER_FEATURES
|
||||
A list of features that the compiler supports. Zero or
|
||||
more of:
|
||||
|
||||
@@ -60,12 +60,13 @@ PIEFLAG?=-fpie
|
||||
|
||||
.asm.pico:
|
||||
${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \
|
||||
${CFLAGS} ${ACFLAGS} \
|
||||
${SHARED_CFLAGS} ${CFLAGS} ${ACFLAGS} \
|
||||
-c ${.IMPSRC} -o ${.TARGET}
|
||||
${CTFCONVERT_CMD}
|
||||
|
||||
.asm.nossppico:
|
||||
${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PICFLAG} -DPIC \
|
||||
${SHARED_CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} \
|
||||
${CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} \
|
||||
${ACFLAGS} \
|
||||
-c ${.IMPSRC} -o ${.TARGET}
|
||||
@@ -73,18 +74,19 @@ PIEFLAG?=-fpie
|
||||
|
||||
.asm.pieo:
|
||||
${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PIEFLAG} -DPIC \
|
||||
${CFLAGS} ${ACFLAGS} \
|
||||
${SHARED_CFLAGS} ${CFLAGS} ${ACFLAGS} \
|
||||
-c ${.IMPSRC} -o ${.TARGET}
|
||||
${CTFCONVERT_CMD}
|
||||
|
||||
.S.pico:
|
||||
${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC \
|
||||
${CFLAGS} ${ACFLAGS} \
|
||||
${SHARED_CFLAGS} ${CFLAGS} ${ACFLAGS} \
|
||||
-c ${.IMPSRC} -o ${.TARGET}
|
||||
${CTFCONVERT_CMD}
|
||||
|
||||
.S.nossppico:
|
||||
${CC:N${CCACHE_BIN}} ${PICFLAG} -DPIC \
|
||||
${SHARED_CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} \
|
||||
${CFLAGS:C/^-fstack-protector.*$//:C/^-fstack-clash-protection.*$//} \
|
||||
${ACFLAGS} \
|
||||
-c ${.IMPSRC} -o ${.TARGET}
|
||||
@@ -92,7 +94,7 @@ PIEFLAG?=-fpie
|
||||
|
||||
.S.pieo:
|
||||
${CC:N${CCACHE_BIN}} ${PIEFLAG} -DPIC \
|
||||
${CFLAGS} ${ACFLAGS} \
|
||||
${SHARED_CFLAGS} ${CFLAGS} ${ACFLAGS} \
|
||||
-c ${.IMPSRC} -o ${.TARGET}
|
||||
${CTFCONVERT_CMD}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user