pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk mk: MKPIE is not GCC-specific. Should help ObjC pac...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/57c586619ae4
branches:  trunk
changeset: 375360:57c586619ae4
user:      nia <nia%pkgsrc.org@localhost>
date:      Sun Mar 13 06:26:57 2022 +0000

description:
mk: MKPIE is not GCC-specific. Should help ObjC packages.

diffstat:

 mk/compiler/clang.mk      |  13 ++++++++++++-
 mk/compiler/gcc.mk        |  13 ++++---------
 mk/cwrappers.mk           |   4 ++--
 mk/wrapper/bsd.wrapper.mk |   4 ++--
 4 files changed, 20 insertions(+), 14 deletions(-)

diffs (105 lines):

diff -r 8b0cf560b508 -r 57c586619ae4 mk/compiler/clang.mk
--- a/mk/compiler/clang.mk      Sun Mar 13 06:20:12 2022 +0000
+++ b/mk/compiler/clang.mk      Sun Mar 13 06:26:57 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: clang.mk,v 1.34 2022/01/30 13:07:34 wiz Exp $
+# $NetBSD: clang.mk,v 1.35 2022/03/13 06:26:57 nia Exp $
 #
 # This is the compiler definition for the clang compiler.
 #
@@ -78,6 +78,17 @@
 CWRAPPERS_PREPEND.cxx+=        ${_RELRO_LDFLAGS}
 .endif
 
+.if ${_PKGSRC_MKPIE} == "yes"
+_MKPIE_CFLAGS.clang=   -fPIC
+_MKPIE_LDFLAGS=                -pie
+
+.  if ${PKGSRC_OVERRIDE_MKPIE:tl} == "no"
+CFLAGS+=               ${_MKPIE_CFLAGS.clang}
+CWRAPPERS_APPEND.cc+=  ${_MKPIE_CFLAGS.clang}
+CWRAPPERS_APPEND.cxx+= ${_MKPIE_CFLAGS.clang}
+.  endif
+.endif
+
 LDFLAGS+=      ${_CLANG_LDFLAGS}
 
 # _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
diff -r 8b0cf560b508 -r 57c586619ae4 mk/compiler/gcc.mk
--- a/mk/compiler/gcc.mk        Sun Mar 13 06:20:12 2022 +0000
+++ b/mk/compiler/gcc.mk        Sun Mar 13 06:26:57 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.235 2022/01/18 01:41:09 pho Exp $
+# $NetBSD: gcc.mk,v 1.236 2022/03/13 06:26:57 nia Exp $
 #
 # This is the compiler definition for the GNU Compiler Collection.
 #
@@ -103,7 +103,7 @@
        _EXTRA_CC_DIRS \
        _CXX_STD_VERSIONS \
        ${_CXX_STD_VERSIONS:@std@_CXX_STD_FLAG.${std}@} \
-       _MKPIE_CFLAGS.gcc _MKPIE_LDFLAGS.gcc \
+       _MKPIE_CFLAGS.gcc _MKPIE_LDFLAGS \
        _FORTIFY_CFLAGS _RELRO_LDFLAGS _STACK_CHECK_CFLAGS \
        _CTF_CFLAGS \
        _GCC_DIR \
@@ -346,21 +346,16 @@
 
 .if ${_PKGSRC_MKPIE} == "yes"
 _MKPIE_CFLAGS.gcc=     -fPIC
-# XXX for executables it should be:
-#_MKPIE_CFLAGS.gcc=    -fPIE
 _MKPIE_FCFLAGS.gcc=    -fPIC
-# XXX for libraries a sink wrapper around gcc is required and used instead
-_MKPIE_LDFLAGS.gcc=    -pie
+# for libraries a sink wrapper around gcc is required and used instead
+_MKPIE_LDFLAGS=                -pie
 
 .  if ${PKGSRC_OVERRIDE_MKPIE:tl} == "no"
 _GCC_CFLAGS+=          ${_MKPIE_CFLAGS.gcc}
 _GCC_FCFLAGS+=         ${_MKPIE_FCFLAGS.gcc}
-#_GCC_LDFLAGS+=                ${_MKPIE_LDFLAGS.gcc}
 CWRAPPERS_APPEND.cc+=  ${_MKPIE_CFLAGS.gcc}
 CWRAPPERS_APPEND.cxx+= ${_MKPIE_CFLAGS.gcc}
 CWRAPPERS_APPEND.f77+= ${_MKPIE_FCFLAGS.gcc}
-# this differs for libraries and executables (handled in mk/cwrappers.mk)
-# CWRAPPERS_APPEND.ld+=        ${_MKPIE_LDFLAGS.gcc}
 .  endif
 .endif
 
diff -r 8b0cf560b508 -r 57c586619ae4 mk/cwrappers.mk
--- a/mk/cwrappers.mk   Sun Mar 13 06:20:12 2022 +0000
+++ b/mk/cwrappers.mk   Sun Mar 13 06:26:57 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: cwrappers.mk,v 1.32 2022/01/18 01:41:09 pho Exp $
+# $NetBSD: cwrappers.mk,v 1.33 2022/03/13 06:26:57 nia Exp $
 #
 # This Makefile fragment implements integration of pkgtools/cwrappers.
 
@@ -90,7 +90,7 @@
 .  endfor
 . if ${_PKGSRC_MKPIE} == "yes"
 .  if ${PKGSRC_OVERRIDE_MKPIE:tl} == "no"
-.    for arg in ${_MKPIE_LDFLAGS.gcc}
+.    for arg in ${_MKPIE_LDFLAGS}
        ${RUN}echo append_executable=${arg} >> ${CWRAPPERS_CONFIG_DIR}/${CWRAPPERS_CONFIG.${wrappee}}
 .    endfor
 .  endif
diff -r 8b0cf560b508 -r 57c586619ae4 mk/wrapper/bsd.wrapper.mk
--- a/mk/wrapper/bsd.wrapper.mk Sun Mar 13 06:20:12 2022 +0000
+++ b/mk/wrapper/bsd.wrapper.mk Sun Mar 13 06:26:57 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.103 2022/01/18 01:41:09 pho Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.104 2022/03/13 06:26:57 nia Exp $
 #
 # Copyright (c) 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -310,7 +310,7 @@
 _WRAP_CMD_SINK.LD=     ${WRAPPER_TMPDIR}/cmd-sink-mkpie-ld
 MKPIE_CFLAGS=          ${_MKPIE_CFLAGS.gcc}
 .export MKPIE_CFLAGS
-MKPIE_LDFLAGS=         ${_MKPIE_LDFLAGS.gcc}
+MKPIE_LDFLAGS=         ${_MKPIE_LDFLAGS}
 .export MKPIE_LDFLAGS
 . endif
 .endif



Home | Main Index | Thread Index | Old Index