| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: gcc.mk,v 1.224 2021/04/06 12:07:57 nia Exp $ | | 1 | # $NetBSD: gcc.mk,v 1.225 2021/08/01 12:35:06 nia Exp $ |
2 | # | | 2 | # |
3 | # This is the compiler definition for the GNU Compiler Collection. | | 3 | # This is the compiler definition for the GNU Compiler Collection. |
4 | # | | 4 | # |
5 | # User-settable variables: | | 5 | # User-settable variables: |
6 | # | | 6 | # |
7 | # GCCBASE | | 7 | # GCCBASE |
8 | # If using a native GCC and the compiler is not in $PATH then | | 8 | # If using a native GCC and the compiler is not in $PATH then |
9 | # this should be set to the base installation directory. | | 9 | # this should be set to the base installation directory. |
10 | # | | 10 | # |
11 | # USE_NATIVE_GCC | | 11 | # USE_NATIVE_GCC |
12 | # When set to "yes", the native gcc is used, no matter which | | 12 | # When set to "yes", the native gcc is used, no matter which |
13 | # compiler version a package requires. | | 13 | # compiler version a package requires. |
14 | # | | 14 | # |
| @@ -373,35 +373,33 @@ LANGUAGES.gcc= c c++ fortran fortran77 o | | | @@ -373,35 +373,33 @@ LANGUAGES.gcc= c c++ fortran fortran77 o |
373 | _LANGUAGES.gcc= # empty | | 373 | _LANGUAGES.gcc= # empty |
374 | .for _lang_ in ${USE_LANGUAGES} | | 374 | .for _lang_ in ${USE_LANGUAGES} |
375 | _LANGUAGES.gcc+= ${LANGUAGES.gcc:M${_lang_}} | | 375 | _LANGUAGES.gcc+= ${LANGUAGES.gcc:M${_lang_}} |
376 | .endfor | | 376 | .endfor |
377 | | | 377 | |
378 | _WRAP_EXTRA_ARGS.cc+= -fcommon | | 378 | _WRAP_EXTRA_ARGS.cc+= -fcommon |
379 | CWRAPPERS_PREPEND.cc+= -fcommon | | 379 | CWRAPPERS_PREPEND.cc+= -fcommon |
380 | | | 380 | |
381 | .if !empty(USE_LANGUAGES:Mc99) | | 381 | .if !empty(USE_LANGUAGES:Mc99) |
382 | _WRAP_EXTRA_ARGS.CC+= -std=gnu99 | | 382 | _WRAP_EXTRA_ARGS.CC+= -std=gnu99 |
383 | CWRAPPERS_APPEND.cc+= -std=gnu99 | | 383 | CWRAPPERS_APPEND.cc+= -std=gnu99 |
384 | .endif | | 384 | .endif |
385 | | | 385 | |
386 | .if ${OPSYS} == "NetBSD" | | 386 | .if ${_PKGSRC_MKPIE} == "yes" |
387 | _MKPIE_CFLAGS.gcc= -fPIC | | 387 | _MKPIE_CFLAGS.gcc= -fPIC |
388 | # XXX for executables it should be: | | 388 | # XXX for executables it should be: |
389 | #_MKPIE_CFLAGS.gcc= -fPIE | | 389 | #_MKPIE_CFLAGS.gcc= -fPIE |
390 | # XXX for libraries a sink wrapper around gcc is required and used instead | | 390 | # XXX for libraries a sink wrapper around gcc is required and used instead |
391 | _MKPIE_LDFLAGS.gcc= -pie | | 391 | _MKPIE_LDFLAGS.gcc= -pie |
392 | .endif | | | |
393 | | | 392 | |
394 | .if ${_PKGSRC_MKPIE} == "yes" | | | |
395 | _GCC_CFLAGS+= ${_MKPIE_CFLAGS.gcc} | | 393 | _GCC_CFLAGS+= ${_MKPIE_CFLAGS.gcc} |
396 | #_GCC_LDFLAGS+= ${_MKPIE_LDFLAGS.gcc} | | 394 | #_GCC_LDFLAGS+= ${_MKPIE_LDFLAGS.gcc} |
397 | CWRAPPERS_APPEND.cc+= ${_MKPIE_CFLAGS.gcc} | | 395 | CWRAPPERS_APPEND.cc+= ${_MKPIE_CFLAGS.gcc} |
398 | CWRAPPERS_APPEND.cxx+= ${_MKPIE_CFLAGS.gcc} | | 396 | CWRAPPERS_APPEND.cxx+= ${_MKPIE_CFLAGS.gcc} |
399 | # this differs for libraries and executables (handled in mk/cwrappers.mk) | | 397 | # this differs for libraries and executables (handled in mk/cwrappers.mk) |
400 | # CWRAPPERS_APPEND.ld+= ${_MKPIE_LDFLAGS.gcc} | | 398 | # CWRAPPERS_APPEND.ld+= ${_MKPIE_LDFLAGS.gcc} |
401 | .endif | | 399 | .endif |
402 | | | 400 | |
403 | .if ${_PKGSRC_MKREPRO} == "yes" | | 401 | .if ${_PKGSRC_MKREPRO} == "yes" |
404 | .export WRKDIR | | 402 | .export WRKDIR |
405 | # XXX the dollar sign should not be expanded by the shell | | 403 | # XXX the dollar sign should not be expanded by the shell |
406 | _GCC_CFLAGS+= -fdebug-prefix-map=$$$$WRKDIR/= | | 404 | _GCC_CFLAGS+= -fdebug-prefix-map=$$$$WRKDIR/= |
407 | .endif | | 405 | .endif |