head 1.45; access; symbols pkgsrc-2023Q4:1.42.0.2 pkgsrc-2023Q4-base:1.42 pkgsrc-2023Q3:1.41.0.2 pkgsrc-2023Q3-base:1.41 pkgsrc-2023Q2:1.39.0.4 pkgsrc-2023Q2-base:1.39 pkgsrc-2023Q1:1.39.0.2 pkgsrc-2023Q1-base:1.39 pkgsrc-2022Q4:1.37.0.4 pkgsrc-2022Q4-base:1.37 pkgsrc-2022Q3:1.37.0.2 pkgsrc-2022Q3-base:1.37 pkgsrc-2022Q2:1.35.0.4 pkgsrc-2022Q2-base:1.35 pkgsrc-2022Q1:1.35.0.2 pkgsrc-2022Q1-base:1.35 pkgsrc-2021Q4:1.32.0.2 pkgsrc-2021Q4-base:1.32 pkgsrc-2021Q3:1.27.0.2 pkgsrc-2021Q3-base:1.27 pkgsrc-2021Q2:1.26.0.8 pkgsrc-2021Q2-base:1.26 pkgsrc-2021Q1:1.26.0.6 pkgsrc-2021Q1-base:1.26 pkgsrc-2020Q4:1.26.0.4 pkgsrc-2020Q4-base:1.26 pkgsrc-2020Q3:1.26.0.2 pkgsrc-2020Q3-base:1.26 pkgsrc-2020Q2:1.25.0.2 pkgsrc-2020Q2-base:1.25 pkgsrc-2020Q1:1.22.0.2 pkgsrc-2020Q1-base:1.22 pkgsrc-2019Q4:1.21.0.6 pkgsrc-2019Q4-base:1.21 pkgsrc-2019Q3:1.21.0.2 pkgsrc-2019Q3-base:1.21 pkgsrc-2019Q2:1.20.0.4 pkgsrc-2019Q2-base:1.20 pkgsrc-2019Q1:1.20.0.2 pkgsrc-2019Q1-base:1.20 pkgsrc-2018Q4:1.19.0.2 pkgsrc-2018Q4-base:1.19 pkgsrc-2018Q3:1.18.0.12 pkgsrc-2018Q3-base:1.18 pkgsrc-2018Q2:1.18.0.10 pkgsrc-2018Q2-base:1.18 pkgsrc-2018Q1:1.18.0.8 pkgsrc-2018Q1-base:1.18 pkgsrc-2017Q4:1.18.0.6 pkgsrc-2017Q4-base:1.18 pkgsrc-2017Q3:1.18.0.4 pkgsrc-2017Q3-base:1.18 pkgsrc-2017Q2:1.17.0.2 pkgsrc-2017Q2-base:1.17 pkgsrc-2017Q1:1.15.0.18 pkgsrc-2017Q1-base:1.15 pkgsrc-2016Q4:1.15.0.16 pkgsrc-2016Q4-base:1.15 pkgsrc-2016Q3:1.15.0.14 pkgsrc-2016Q3-base:1.15 pkgsrc-2016Q2:1.15.0.12 pkgsrc-2016Q2-base:1.15 pkgsrc-2016Q1:1.15.0.10 pkgsrc-2016Q1-base:1.15 pkgsrc-2015Q4:1.15.0.8 pkgsrc-2015Q4-base:1.15 pkgsrc-2015Q3:1.15.0.6 pkgsrc-2015Q3-base:1.15 pkgsrc-2015Q2:1.15.0.4 pkgsrc-2015Q2-base:1.15 pkgsrc-2015Q1:1.15.0.2 pkgsrc-2015Q1-base:1.15 pkgsrc-2014Q4:1.14.0.2 pkgsrc-2014Q4-base:1.14 pkgsrc-2014Q3:1.13.0.10 pkgsrc-2014Q3-base:1.13 pkgsrc-2014Q2:1.13.0.8 pkgsrc-2014Q2-base:1.13 pkgsrc-2014Q1:1.13.0.6 pkgsrc-2014Q1-base:1.13 pkgsrc-2013Q4:1.13.0.4 pkgsrc-2013Q4-base:1.13 pkgsrc-2013Q3:1.13.0.2 pkgsrc-2013Q3-base:1.13 pkgsrc-2013Q2:1.12.0.2 pkgsrc-2013Q2-base:1.12 pkgsrc-2013Q1:1.8.0.2 pkgsrc-2013Q1-base:1.8 pkgsrc-2012Q4:1.7.0.12 pkgsrc-2012Q4-base:1.7 pkgsrc-2012Q3:1.7.0.10 pkgsrc-2012Q3-base:1.7 pkgsrc-2012Q2:1.7.0.8 pkgsrc-2012Q2-base:1.7 pkgsrc-2012Q1:1.7.0.6 pkgsrc-2012Q1-base:1.7 pkgsrc-2011Q4:1.7.0.4 pkgsrc-2011Q4-base:1.7 pkgsrc-2011Q3:1.7.0.2 pkgsrc-2011Q3-base:1.7 pkgsrc-2011Q2:1.6.0.6 pkgsrc-2011Q2-base:1.6 pkgsrc-2011Q1:1.6.0.4 pkgsrc-2011Q1-base:1.6 pkgsrc-2010Q4:1.6.0.2 pkgsrc-2010Q4-base:1.6 pkgsrc-2010Q3:1.1.0.2 pkgsrc-2010Q3-base:1.1; locks; strict; comment @# @; 1.45 date 2024.03.27.11.33.00; author schmonz; state Exp; branches; next 1.44; commitid wkM5738LSLOg6N3F; 1.44 date 2024.03.20.10.47.22; author schmonz; state Exp; branches; next 1.43; commitid t9K7MOUNW8IX3T2F; 1.43 date 2024.03.19.21.12.47; author schmonz; state Exp; branches; next 1.42; commitid cSQGjHtLZSNRyO2F; 1.42 date 2023.10.18.08.48.51; author jperkin; state Exp; branches; next 1.41; commitid b5aEGYwwSNSil5JE; 1.41 date 2023.07.29.17.55.47; author nia; state Exp; branches; next 1.40; commitid bYOhbbPBMMPPZIyE; 1.40 date 2023.06.27.10.27.21; author riastradh; state Exp; branches; next 1.39; commitid YYdDXuq2VpGTxzuE; 1.39 date 2023.01.06.23.11.31; author wiz; state Exp; branches; next 1.38; commitid 6rkuHCYOeWwNix8E; 1.38 date 2022.12.31.08.35.37; author wiz; state Exp; branches; next 1.37; commitid hVeNM3jZWWhaEG7E; 1.37 date 2022.07.07.17.19.55; author jperkin; state Exp; branches; next 1.36; commitid kSogA7p2lFfAeZKD; 1.36 date 2022.07.05.17.32.24; author jperkin; state Exp; branches; next 1.35; commitid byyzMra37bnSlJKD; 1.35 date 2022.03.13.06.26.57; author nia; state Exp; branches; next 1.34; commitid GfTNBnrOwYi3m1wD; 1.34 date 2022.01.30.13.07.34; author wiz; state Exp; branches; next 1.33; commitid ZibN1heI6AA4VEqD; 1.33 date 2022.01.19.16.06.43; author pho; state Exp; branches; next 1.32; commitid rLLmk8toR23DggpD; 1.32 date 2021.12.19.11.55.29; author nia; state Exp; branches; next 1.31; commitid OzozUJ7nmDp6SflD; 1.31 date 2021.11.07.11.25.33; author nia; state Exp; branches; next 1.30; commitid RoNixqAXtsJs3RfD; 1.30 date 2021.11.06.10.03.32; author nia; state Exp; branches; next 1.29; commitid Za468HuEaFHiDIfD; 1.29 date 2021.11.02.08.14.58; author nia; state Exp; branches; next 1.28; commitid cwUDJjUD2Sk5acfD; 1.28 date 2021.10.04.14.21.21; author nia; state Exp; branches; next 1.27; commitid xGEEtbG0IkNB7vbD; 1.27 date 2021.08.03.07.28.15; author nia; state Exp; branches; next 1.26; commitid ResyAJ9Kb5yvPu3D; 1.26 date 2020.09.21.13.09.21; author schmonz; state Exp; branches; next 1.25; commitid lnOvCCDP5rFkSUoC; 1.25 date 2020.04.17.13.36.26; author joerg; state Exp; branches; next 1.24; commitid P8UE7CemX3cr4K4C; 1.24 date 2020.04.17.13.35.36; author joerg; state Exp; branches; next 1.23; commitid Lls7qPBx45W34K4C; 1.23 date 2020.03.30.09.39.24; author nia; state Exp; branches; next 1.22; commitid FlTBM2zTqjmZkp2C; 1.22 date 2020.03.14.10.00.37; author nia; state Exp; branches; next 1.21; commitid g1MGcNTWA3Z6Yl0C; 1.21 date 2019.07.15.16.06.19; author ryoon; state Exp; branches; next 1.20; commitid Pxolurm8KLiUN9vB; 1.20 date 2019.01.09.13.19.03; author wiz; state Exp; branches; next 1.19; commitid IHlBnmPelQN8T67B; 1.19 date 2018.11.12.14.22.58; author jperkin; state Exp; branches; next 1.18; commitid gHxFSFEcfM6Q5FZA; 1.18 date 2017.07.11.19.41.20; author joerg; state Exp; branches; next 1.17; commitid zPbN8GDmm2ImAQYz; 1.17 date 2017.05.18.08.14.08; author jperkin; state Exp; branches; next 1.16; commitid SgyEQG3swFv9wQRz; 1.16 date 2017.05.18.01.29.55; author khorben; state Exp; branches; next 1.15; commitid GNDO6edjmxR9hORz; 1.15 date 2015.03.02.19.59.07; author joerg; state Exp; branches; next 1.14; commitid aMeGSDJmehh6o4cy; 1.14 date 2014.12.03.14.05.25; author joerg; state Exp; branches; next 1.13; commitid BGK6jKgis6bsiB0y; 1.13 date 2013.07.31.06.37.27; author adam; state Exp; branches; next 1.12; commitid GotNF4gNkPnmzAZw; 1.12 date 2013.05.29.13.19.02; author joerg; state Exp; branches; next 1.11; commitid CJA0kt2O86DDOwRw; 1.11 date 2013.05.22.12.13.35; author joerg; state Exp; branches; next 1.10; commitid cqnMfozuPhD4GCQw; 1.10 date 2013.05.09.23.37.26; author riastradh; state Exp; branches; next 1.9; 1.9 date 2013.05.09.14.01.08; author joerg; state Exp; branches; next 1.8; 1.8 date 2013.02.21.07.57.19; author wiz; state Exp; branches; next 1.7; 1.7 date 2011.07.19.14.02.47; author joerg; state Exp; branches; next 1.6; 1.6 date 2010.12.26.14.09.01; author asau; state Exp; branches; next 1.5; 1.5 date 2010.12.26.09.46.24; author adam; state Exp; branches; next 1.4; 1.4 date 2010.12.26.08.12.30; author adam; state Exp; branches; next 1.3; 1.3 date 2010.11.03.18.05.05; author adam; state Exp; branches; next 1.2; 1.2 date 2010.10.21.13.55.13; author adam; state Exp; branches; next 1.1; 1.1 date 2010.09.23.22.26.07; author ahoka; state Exp; branches; next ; desc @@ 1.45 log @clang: note precise Apple clang version in comment. @ text @# $NetBSD: clang.mk,v 1.44 2024/03/20 10:47:22 schmonz Exp $ # # This is the compiler definition for the clang compiler. # # User-settable variables: # # CLANGBASE # The base directory where the compiler is installed. # .if !defined(COMPILER_CLANG_MK) COMPILER_CLANG_MK= defined # Add the dependency on clang # TODO: may be installed already, check for this #TOOL_DEPENDS+= clang-[0-9]*:../../lang/clang .include "../../mk/bsd.prefs.mk" CLANGBASE?= ${TOOLBASE} LANGUAGES.clang= # empty .if exists(${CLANGBASE}/bin/clang) LANGUAGES.clang+= c objc _COMPILER_STRIP_VARS+= CC CCPATH= ${CLANGBASE}/bin/clang PKG_CC:= ${CCPATH} .endif .if exists(${CLANGBASE}/bin/clang++) LANGUAGES.clang+= c++ _COMPILER_STRIP_VARS+= CXX CXXPATH= ${CLANGBASE}/bin/clang++ PKG_CXX:= ${CXXPATH} .endif .if exists(${CLANGBASE}/bin/clang-cpp) CPPPATH= ${CLANGBASE}/bin/clang-cpp PKG_CPP:= ${CPPPATH} .endif .if !defined(CC_VERSION) . if exists(${CCPATH}) CLANG_VERSION!= ${CCPATH} -dumpversion 2>&1 || ${ECHO} 0 . else CLANG_VERSION= 0 . endif CC_VERSION= clang-${CLANG_VERSION} .endif # # TODO: CC_VERSION_STRING is obsolete and should be removed at some point. # CC_VERSION_STRING= ${CC_VERSION} _COMPILER_ABI_FLAG.32= -m32 _COMPILER_ABI_FLAG.64= -m64 .include "gcc-style-args.mk" LDFLAGS+= ${_CLANG_LDFLAGS} # _LANGUAGES. is ${LANGUAGES.} restricted to the # ones requested by the package in USE_LANGUAGES. # _LANGUAGES.clang= # empty .for _lang_ in ${USE_LANGUAGES} _LANGUAGES.clang+= ${LANGUAGES.clang:M${_lang_}} .endfor PKGSRC_FORTRAN?=gfortran .if !empty(PKGSRC_FORTRAN) && (!empty(USE_LANGUAGES:Mfortran) || !empty(USE_LANGUAGES:Mfortran77)) . include "../../mk/compiler/${PKGSRC_FORTRAN}.mk" .endif _WRAP_EXTRA_ARGS.CC+= -Qunused-arguments CWRAPPERS_APPEND.cc+= -Qunused-arguments CWRAPPERS_PREPEND.cc+= -Qunused-arguments _WRAP_EXTRA_ARGS.CXX+= -Qunused-arguments CWRAPPERS_APPEND.cxx+= -Qunused-arguments .if defined(_PKGSRC_BARRIER) # Xcode 12 (Apple clang-1200.0.32.2) and upstream Clang 16 have a # zealous new default that the wide world of random third-party software # isn't ready for. Turn it back off by default. # # Packages and users can override via CFLAGS/CPPFLAGS. _NOERROR_IMPLICIT_cmd= ${CCPATH} -\#\#\# -E -x c /dev/null \ 2>&1 \ | ${GREP} -q Werror=implicit-function-declaration \ && ${ECHO} -Wno-error=implicit-function-declaration \ || ${TRUE} CWRAPPERS_PREPEND.cc+= ${_NOERROR_IMPLICIT_cmd:sh} # Xcode 15 (Apple clang-1500.3.9.4) and upstream Clang 16 have several # more zealous new defaults. We can't default them off as precisely # (they don't show up in `clang -###` output), so we simply attempt to # turn them off for any clang that doesn't complain when we try. # # Packages and users can override via CFLAGS/CPPFLAGS. # # As soon as 2024Q1 branches, we should: # # 1. Do a bulk build with all these -Wno-error tweaks removed, so we can # see how much is broken. # 2. If it's "too much" breakage and we'll have to keep overriding these # compiler defaults for "a while", find a way to accomplish them with # fewer compiler invocations. (Some ideas: define a default # FORCE_C_STD, or apply overrides keyed on CC_VERSION or similar.) Do # a bulk build to make sure things continue to work as before. # 3. Otherwise, fix as much as we can before 2024Q2. This will help with # gcc 14 (which has many similar new defaults) as well. _WERROR_CLANG16= implicit-int int-conversion incompatible-pointer-types _NOERROR_CLANG16_cmd= for _warn_ in ${_WERROR_CLANG16}; do \ ${CCPATH} -\#\#\# -Wno-error=$${_warn_} -x c /dev/null \ >/dev/null 2>&1 \ && ${ECHO} -Wno-error=$${_warn_} \ || ${TRUE}; \ done CWRAPPERS_PREPEND.cc+= ${_NOERROR_CLANG16_cmd:sh} .endif .for _version_ in ${_CXX_STD_VERSIONS} _CXX_STD_FLAG.${_version_}?= -std=${_version_} .endfor .endif # COMPILER_CLANG_MK @ 1.44 log @clang.mk: avoid slowing pbulk-index, use _PKGSRC_BARRIER. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.43 2024/03/19 21:12:47 schmonz Exp $ d84 3 a86 3 # Xcode 12 and upstream Clang 16 have a zealous new default that the # wide world of random third-party software isn't ready for. Turn it # back off by default. @ 1.43 log @clang.mk: paper over new macOS and upstream defaults. As soon as 2024Q1 branches, we should: 1. Do a bulk build with all these -Wno-error tweaks removed, so we can see how much is broken. 2. If it's "too much" breakage and we'll have to keep overriding these compiler defaults for "a while", find a way to accomplish them with fewer compiler invocations. (Some ideas: define a default FORCE_C_STD, or apply overrides keyed on CC_VERSION or similar.) Do a bulk build to make sure things continue to work as before. 3. Otherwise, fix as much as we can before 2024Q2. This will help with gcc 14 (which has many similar new defaults) as well. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.42 2023/10/18 08:48:51 jperkin Exp $ d83 1 d122 1 @ 1.42 log @mk/compiler: Improve clang CC_VERSION setting. Use -dumpversion, supported in all modern versions, rather than digging out the version with sed. Allow CC_VERSION to be preset by the user, and set the obsolete CC_VERSION_STRING variable to be the same as CC_VERSION rather than setting it to the verbose version output. Default to "clang-0" rather than just "clang" if CCPATH is not available so that matching elsewhere can be more uniform. With CC_VERSION preset this improves speed of 'make pbulk-index' in simple packages by around 30%, and reduces system time by 50%. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.41 2023/07/29 17:55:47 nia Exp $ d83 7 a89 4 # Xcode 12 has a zealous new default. Turn it off until we're ready, # while allowing callers (or users, via CFLAGS/CPPFLAGS) to override. .if ${OPSYS} == "Darwin" _NOERROR_IMPLICIT_cmd= ${CCPATH} -\#\#\# -E -x c /dev/null 2>&1 \ d94 27 a120 1 .endif @ 1.41 log @mk: Begin to refactor common support for GCC/Clang into a single file. They share lots of command line argument features and it doesn't make sense to duplicate our work. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.40 2023/06/27 10:27:21 riastradh Exp $ d42 7 a48 6 .if exists(${CCPATH}) CC_VERSION_STRING!= ${CCPATH} -v 2>&1 CC_VERSION!= ${CCPATH} --version 2>&1 | ${SED} -n "s/^.* version /clang-/p" .else CC_VERSION_STRING?= ${CC_VERSION} CC_VERSION?= clang d51 5 @ 1.40 log @Split native and cross LOCALBASE for cross-compilation. This way, you can use an unprivileged prefix of ~/cross/pkg to cross-compile packages that, when installed, will go in /usr/pkg. In mk.conf: - Set CROSS_LOCALBASE to determine the installation prefix of packages that you cross-compile. - Set LOCALBASE to determine the installation prefix of native packages needed for cross compilation. Both default to /usr/pkg. Note: CROSS_LOCALBASE defaults to /usr/pkg even if you set LOCALBASE. Of course, if you're not cross-compiling, this has no effect. When cross-compiling a package: - LOCALBASE is where cross-compiled packages will be installed. (`make install' will put it in ${CROSS_DESTDIR}${LOCALBASE}, of course, but when you later use pkg_add to install the binary package on the system you're compiling it for, it will go in ${LOCALBASE}. And you can still set PREFIX for an individual package, but LOCALBASE refers to where cross-compiled packages are generally installed, other than the specific ones that override PREFIX.) - TOOLBASE is where tool dependencies are installed and available to be executed at build-time. For example, if you have TOOL_DEPENDS on a program that is installed in (say) foo/bin/xyz which is not in PATH so you have to refer ot its full pathname, you can execute ${TOOLBASE}/foo/bin/xyz instead of ${LOCALBASE}/foo/bin/xyz. I chose this split, rather than the other way around, because I expect that references that are baked into installed packages to be more common than references that are executed at build-time, but I didn't do an extensive study of the matter. I chose the name TOOLBASE because it's where TOOL_DEPENDS go. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.39 2023/01/06 23:11:31 wiz Exp $ a51 22 _COMPILER_LD_FLAG= -Wl, _LINKER_RPATH_FLAG= -R _COMPILER_RPATH_FLAG= ${_COMPILER_LD_FLAG}${_LINKER_RPATH_FLAG} _CTF_CFLAGS= -gdwarf-2 # The user or package can choose the level of RELRO. .if ${PKGSRC_USE_RELRO} != "partial" && \ ${RELRO_SUPPORTED:Uyes:tl} != "partial" _RELRO_LDFLAGS= -Wl,-zrelro -Wl,-znow .else _RELRO_LDFLAGS= -Wl,-zrelro .endif # The user can choose the level of stack smashing protection. .if ${PKGSRC_USE_SSP} == "all" _SSP_CFLAGS= -fstack-protector-all .elif ${PKGSRC_USE_SSP} == "strong" _SSP_CFLAGS= -fstack-protector-strong .else _SSP_CFLAGS= -fstack-protector .endif d53 1 a53 16 .if ${_PKGSRC_USE_RELRO} == "yes" _CLANG_LDFLAGS+= ${_RELRO_LDFLAGS} CWRAPPERS_PREPEND.cc+= ${_RELRO_LDFLAGS} 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 d71 1 a71 1 _WRAP_EXTRA_ARGS.CC+= -Qunused-arguments -fcommon d73 1 a73 1 CWRAPPERS_PREPEND.cc+= -Qunused-arguments -fcommon @ 1.39 log @mk: remove relro hack for NetBSD-current, fixed in the base system @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.38 2022/12/31 08:35:37 wiz Exp $ d20 1 a20 1 CLANGBASE?= ${LOCALBASE} @ 1.38 log @mk: work around binutils 2.39 problem with relro on NetBSD @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.37 2022/07/07 17:19:55 jperkin Exp $ a64 6 # XXX Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1014301 # Set manually the maxpagesize to 4096 which is ok for now since NetBSD only # supports relro by default on x86 and aarch64 .if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} > 109901 _RELRO_LDFLAGS+= -Wl,-z,max-page-size=4096 .endif @ 1.37 log @mk: Remove -std overrides for clang. Reported to cause problems on FreeBSD, and clang is generally pretty aggressive about defaulting to newer versions anyway. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.36 2022/07/05 17:32:24 jperkin Exp $ d44 1 a44 1 CC_VERSION!= ${CCPATH} --version 2>&1 | ${SED} -n "s/^.* version /clang-/p" d65 6 @ 1.36 log @mk: Add support for newer C standards. For now the GCC "c99 == gnu99" override is kept, but gnu99 is now supported as a specific value for USE_LANGUAGES, so we may want to be specific where required. c11 and c17 (and the corresponding gnu11/gnu17 versions) are newly supported. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.35 2022/03/13 06:26:57 nia Exp $ a123 4 .for _version_ in ${_C_STD_VERSIONS} _C_STD_FLAG.${_version_}?= -std=${_version_} .endfor @ 1.35 log @mk: MKPIE is not GCC-specific. Should help ObjC packages. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.34 2022/01/30 13:07:34 wiz Exp $ d124 4 @ 1.34 log @compiler/clang.mk: do not disable PIE support joerg says clang has the same interface for this like gcc @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.33 2022/01/19 16:06:43 pho Exp $ d81 11 @ 1.33 log @Emit a warning when PKGSRC_MKPIE==yes but PKGSRC_COMPILER==clang Prior to this change PKGSRC_MKPIE was silently ignored when clang was chosen for the compiler, i.e. executables were never built as PIE. This became an error after introducing a post-build check for it. Of course we should add a MKPIE support for clang, but for now we just emit a warning. Otherwise we cannot build packages such as devel/gnustep-base which requires clang to build. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.32 2021/12/19 11:55:29 nia Exp $ a116 5 .if ${_PKGSRC_MKPIE} == "yes" WARNINGS+= "[clang.mk] PKGSRC_MKPIE is currently not supported for clang" CHECK_PIE_SUPPORTED= no .endif @ 1.32 log @mk/compiler: Return the cwrappers stuff for RELRO now that it doesn't cause any noticable breakage. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.31 2021/11/07 11:25:33 nia Exp $ d117 5 @ 1.31 log @mk: revert RELRO default and cease use of wrappers until some more substantial changes to infrastructure and testing can be performed to ensure it's applied universally without breaking anything @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.30 2021/11/06 10:03:32 nia Exp $ d77 2 @ 1.30 log @mk: Correct the wrappers invocation for RELRO. This should help many remaining packages that fail to build with RELRO that were uncaught by my original bulk builds due to CHECK_RELRO failing to work (sorry...) @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.29 2021/11/02 08:14:58 nia Exp $ a76 2 CWRAPPERS_APPEND.cc+= ${_RELRO_LDFLAGS} CWRAPPERS_APPEND.cxx+= ${_RELRO_LDFLAGS} @ 1.29 log @mk: Make it possible for a package to fall back to partial RELRO. This helps certain X.Org modules. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.28 2021/10/04 14:21:21 nia Exp $ d77 2 a78 1 CWRAPPERS_APPEND.ld+= ${_RELRO_LDFLAGS} @ 1.28 log @mk: omit space between -z and relro prevents mangling by wrappers in mysterious circumstances @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.27 2021/08/03 07:28:15 nia Exp $ d58 5 a62 2 # The user can choose the level of RELRO. .if ${PKGSRC_USE_RELRO} == "partial" a63 2 .else _RELRO_LDFLAGS= -Wl,-zrelro -Wl,-znow @ 1.27 log @clang.mk: add support for PKGSRC_USE_SSP=strong @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.26 2020/09/21 13:09:21 schmonz Exp $ d60 1 a60 1 _RELRO_LDFLAGS= -Wl,-z,relro d62 1 a62 1 _RELRO_LDFLAGS= -Wl,-z,relro -Wl,-z,now @ 1.26 log @Xcode 12 (or its associated Command Line Tools) ships with default-on -Werror=implicit-function-declaration, which will be great someday when we're ready for it. Until then, on macOS, detect this situation and tell the cc wrapper to prepend -Wno-error=implicit-function-declaration. Taking mail/qmail as our example, this fixes the build on Catalina with "Apple clang version 12.0.0 (clang-1200.0.32.2)". Adding -Werror=implicit-function-declaration to CPPFLAGS or CFLAGS (in mk.conf or on the command line) re-fails the build, as expected, with a pile of "error: implicit declaration of function". Also as expected, a full -Werror fails earlier on one of the many other problems with qmail's code. For clang on non-macOS platforms, no change. clang-and-wrapper-ok: joerg@@ during-the-freeze-ok: gdt@@ @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.25 2020/04/17 13:36:26 joerg Exp $ d68 2 @ 1.25 log @Adjust last to really prepend in the case of cwrappers. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.24 2020/04/17 13:35:36 joerg Exp $ d99 10 @ 1.24 log @clang 10 defaults to -fno-common with significant fallout in pkgsrc. Override that by prepending -fcommon. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.23 2020/03/30 09:39:24 nia Exp $ d94 2 a95 1 CWRAPPERS_APPEND.cc+= -Qunused-arguments -fcommon @ 1.23 log @mk/compiler: Make gfortran the default fortran compiler. Discussed on tech-pkg@@ before freeze. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.22 2020/03/14 10:00:37 nia Exp $ d93 2 a94 2 _WRAP_EXTRA_ARGS.CC+= -Qunused-arguments CWRAPPERS_APPEND.cc+= -Qunused-arguments @ 1.22 log @mk: default to gfortran on aarch64, there's no g95 for aarch64 @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.21 2019/07/15 16:06:19 ryoon Exp $ a86 1 .if !empty(MACHINE_ARCH:Maarch64*) a87 3 .else PKGSRC_FORTRAN?=g95 .endif @ 1.21 log @Do not pass -std=c++03 to GCC 4.4 No objection on tech-pkg@@. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.20 2019/01/09 13:19:03 wiz Exp $ d87 3 d91 1 @ 1.20 log @Add RELRO support for clang, based on the gcc logic. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.19 2018/11/12 14:22:58 jperkin Exp $ d98 4 @ 1.19 log @mk: Add CTF infrastructure support. Platform support is determined by _OPSYS_SUPPORTS_CTF from mk/platform, the user enables support by setting PKGSRC_USE_CTF=yes, and packages can explicitly disable support with CTF_SUPPORTED=no or skip certain files with CTF_FILES_SKIP. The path to ctfconvert is configured via TOOLS_PLATFORM.ctfconvert. If all of the requisite variables are enabled, a compiler-specific debug flag is passed via the wrappers to ensure we have DWARF information to convert, _INSTALL_UNSTRIPPED is explicitly defined to avoid binaries being stripped prior to conversion, and the conversion is performed during the install stage. It is recommended that users who enable the feature also set STRIP_DEBUG=yes to reduce the final binary size once the conversion has been performed. This has been used for the past year in Joyent SmartOS builds. FreeBSD is marked as supported but is untested. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.18 2017/07/11 19:41:20 joerg Exp $ d58 7 d72 7 @ 1.18 log @Retire CLANG_NO_VALUE_PROPAGATION_PASS. CVP has been fixed in LLVM to require much less memory. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.17 2017/05/18 08:14:08 jperkin Exp $ d56 2 @ 1.17 log @Consolidate setting of SSP flags now that multiple compilers support it. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.16 2017/05/18 01:29:55 khorben Exp $ a81 2 CLANG_NO_VALUE_PROPAGATION_PASS= -O0 @ 1.16 log @Register support for SSP on FreeBSD and clang (on x86 architectures) Support for SSP (Stack-Smashing Protection) is optional so this should not affect default builds. Tested on FreeBSD/amd64 (10.3-RELEASE-p11) @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.15 2015/03/02 19:59:07 joerg Exp $ a62 8 .if ${_PKGSRC_USE_SSP} == "yes" _WRAP_EXTRA_ARGS.CC+= ${_SSP_CFLAGS} _WRAP_EXTRA_ARGS.CXX+= ${_SSP_CFLAGS} CWRAPPERS_APPEND.cc+= ${_SSP_CFLAGS} CWRAPPERS_APPEND.cxx+= ${_SSP_CFLAGS} CWRAPPERS_APPEND.f77+= ${_SSP_CFLAGS} .endif @ 1.15 log @LLVM's correlated value propagation pass is known to require a lot of memory and CPU time for certain input. Provide a variable (CLANG_NO_VALUE_PROPAGATION_PASS) for selectively disabling it in those places known to trigger it. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.14 2014/12/03 14:05:25 joerg Exp $ d56 15 @ 1.14 log @cwrappers should get -Qunused-arguments too. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.13 2013/07/31 06:37:27 adam Exp $ d75 2 @ 1.13 log @Construct CC_VERSION differenty; fix for Xcode where clang reports itself as Apple LLVM @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.12 2013/05/29 13:19:02 joerg Exp $ d71 1 d73 1 @ 1.12 log @No trailing comma after -R @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.11 2013/05/22 12:13:35 joerg Exp $ d44 1 a44 1 CC_VERSION!= ${CCPATH} --version 2>&1 | ${SED} -n "s/clang version /clang-/p" @ 1.11 log @Use -R as LINKER_RPATH_FLAG like GCC. The patches for lang/gcc47 and lang/gcc48 don't work otherwise. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.10 2013/05/09 23:37:26 riastradh Exp $ d54 1 a54 1 _COMPILER_RPATH_FLAG= ${_COMPILER_LD_FLAG}${_LINKER_RPATH_FLAG}, @ 1.10 log @Split BUILD_DEPENDS into TOOL_DEPENDS and BUILD_DEPENDS in mk/. Build depends are target packages that are needed at build-time for, e.g., static libraries to link against, header files to include, &c. Tool depends are native packages that are needed at build-time for, e.g., compilers/linkers/&c. to run. ok agc @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.9 2013/05/09 14:01:08 joerg Exp $ d53 1 a53 1 _LINKER_RPATH_FLAG= -rpath @ 1.9 log @Use g95 as default Fortran compiler. Would be nice to use more modern GCC, but that requires cleaning up mk/compiler/gcc.mk first. Only include the fortran compiler file, if Fortran is actually requested. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.8 2013/02/21 07:57:19 wiz Exp $ d16 1 a16 1 #BUILD_DEPENDS+= clang-[0-9]*:../../lang/clang @ 1.8 log @clang -dumpversion prints 4.2.1, which is not the intended content of CC_VERSION. Use clang --version | sed to get a more usable string. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.7 2011/07/19 14:02:47 joerg Exp $ d64 1 a64 1 PKGSRC_FORTRAN?=f2c d66 1 a66 1 .if !empty(PKGSRC_FORTRAN) @ 1.7 log @If the clang-cpp alias exists, use it as default CPP in pkgsrc. Default to f2c for Fortran, mirroring gcc. Append -Qunused-arguments in the wrappers to unbreak many stupid configure checks that get confused by the (also added) -L options. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.6 2010/12/26 14:09:01 asau Exp $ d44 1 a44 1 CC_VERSION!= ${CCPATH} -dumpversion 2>&1 @ 1.6 log @Don't make Fortran synonymous to Fortran-77, it isn't so already. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.5 2010/12/26 09:46:24 adam Exp $ d37 5 d64 3 a66 1 .if defined(PKGSRC_FORTRAN) && !empty(PKGSRC_FORTRAN) d70 3 @ 1.5 log @Enable Fortran via f2c @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.4 2010/12/26 08:12:30 adam Exp $ d59 2 a60 2 .if !(empty(USE_LANGUAGES:Mfortran) && empty(USE_LANGUAGES:Mfortran77)) .include "../../mk/compiler/f2c.mk" @ 1.4 log @Added COMPILER_ABI_FLAGs @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.3 2010/11/03 18:05:05 adam Exp $ a36 7 # Mimic GCC behaviour by defaulting to C89 #.if !empty(USE_LANGUAGES:Mc99) #_WRAP_EXTRA_ARGS.CC+= -std=gnu99 #.else #_WRAP_EXTRA_ARGS.CC+= -std=gnu89 #.endif d59 4 @ 1.3 log @* Use LOCALBASE instead of PREFIX for PCC and Clang compiler detection (otherwise Makefiles with mk/compiler.mk included fall back to GCC). * Simplified compiler/clang.mk. @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.2 2010/10/21 13:55:13 adam Exp $ d52 2 @ 1.2 log @Fix clang.mk; add C++ support @ text @d1 1 a1 1 # $NetBSD: clang.mk,v 1.1 2010/09/23 22:26:07 ahoka Exp $ d20 1 a20 2 CLANGBASE?= ${PREFIX} a22 3 _CLANG_DIR= ${CLANGBASE}/bin _CLANG_VARS= # empty d24 4 a27 6 LANGUAGES.clang+= c _CLANG_VARS+= CC _CLANG_CC= ${_CLANG_DIR}/clang _ALIASES.CC= cc gcc c89 c99 CCPATH= ${_CLANG_DIR}/clang PKG_CC:= ${_CLANG_CC} d32 3 a34 5 _CLANG_VARS+= CXX _CLANG_CXX= ${_CLANG_DIR}/clang++ _ALIASES.CXX= c++ g++ CXXPATH= ${_CLANG_DIR}/clang++ PKG_CXX:= ${_CLANG_CXX} a36 2 _COMPILER_STRIP_VARS+= ${_CLANG_VARS} a43 4 _LINKER_RPATH_FLAG= -rpath, _COMPILER_RPATH_FLAG= -Wl,-rpath, d52 4 @ 1.1 log @Add support for clang. @ text @d1 1 a1 1 # $NetBSD: pcc.mk,v 1.2 2010/07/30 07:58:59 asau Exp $ d16 1 a16 1 BUILD_DEPENDS+= clang-[0-9]*:../../lang/clang a23 1 #_CLANG_DIR= ${WRKDIR}/.clang d28 1 a28 1 LANGUAGES.hp+= c d32 1 a32 1 CCPATH= ${CLANGBASE}/bin/clang a35 1 # NOTE: clang C++ support is still experimental, enable later d37 6 a42 6 #LANGUAGES.hp+= c++ #_CLANG_VARS+= CXX #_CLANG_CXX= ${_CLANG_DIR}/clang++ #_ALIASES.CXX= c++ g++ #CXXPATH= ${CLANGBASE}/bin/clang++ #PKG_CXX:= ${_CLANG_CXX} @