* [PATCH] build: unbreak bootstrap on uclinux targets [PR112762]
@ 2023-12-05 18:49 Marek Polacek
2023-12-06 8:01 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Marek Polacek @ 2023-12-05 18:49 UTC (permalink / raw)
To: GCC Patches
Tested with .../configure --target=c6x-uclinux [...] && make all-gcc,
ok for trunk?
-- >8 --
Currently, cross-compiling with --target=c6x-uclinux (and several other)
fails due to:
../../src/gcc/config/linux.h:221:45: error: 'linux_fortify_source_default_level' was not declared in this scope
#define TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL linux_fortify_source_default_level
In the PR Andrew mentions that another fix would be in config.gcc,
but really, here I meant to use the target hook for glibc only, not
uclibc. This trivial patch fixes the build problem. It means that
-fhardened with uclibc will use -D_FORTIFY_SOURCE=2 and not =3.
PR target/112762
gcc/ChangeLog:
* config/linux.h: Redefine TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL for
glibc only.
---
gcc/config/linux.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 79b6537dcf1..73f39d3c603 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -215,7 +215,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# undef TARGET_LIBM_FUNCTION_MAX_ERROR
# define TARGET_LIBM_FUNCTION_MAX_ERROR linux_libm_function_max_error
-#endif
-
#undef TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL
#define TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL linux_fortify_source_default_level
+
+#endif
base-commit: 9c3a880feecf81c310b4ade210fbd7004c9aece7
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] build: unbreak bootstrap on uclinux targets [PR112762]
2023-12-05 18:49 [PATCH] build: unbreak bootstrap on uclinux targets [PR112762] Marek Polacek
@ 2023-12-06 8:01 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-12-06 8:01 UTC (permalink / raw)
To: Marek Polacek; +Cc: GCC Patches
On Tue, Dec 5, 2023 at 7:50 PM Marek Polacek <polacek@redhat.com> wrote:
>
> Tested with .../configure --target=c6x-uclinux [...] && make all-gcc,
> ok for trunk?
OK
> -- >8 --
> Currently, cross-compiling with --target=c6x-uclinux (and several other)
> fails due to:
>
> ../../src/gcc/config/linux.h:221:45: error: 'linux_fortify_source_default_level' was not declared in this scope
> #define TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL linux_fortify_source_default_level
>
> In the PR Andrew mentions that another fix would be in config.gcc,
> but really, here I meant to use the target hook for glibc only, not
> uclibc. This trivial patch fixes the build problem. It means that
> -fhardened with uclibc will use -D_FORTIFY_SOURCE=2 and not =3.
>
> PR target/112762
>
> gcc/ChangeLog:
>
> * config/linux.h: Redefine TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL for
> glibc only.
> ---
> gcc/config/linux.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/config/linux.h b/gcc/config/linux.h
> index 79b6537dcf1..73f39d3c603 100644
> --- a/gcc/config/linux.h
> +++ b/gcc/config/linux.h
> @@ -215,7 +215,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
> # undef TARGET_LIBM_FUNCTION_MAX_ERROR
> # define TARGET_LIBM_FUNCTION_MAX_ERROR linux_libm_function_max_error
>
> -#endif
> -
> #undef TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL
> #define TARGET_FORTIFY_SOURCE_DEFAULT_LEVEL linux_fortify_source_default_level
> +
> +#endif
>
> base-commit: 9c3a880feecf81c310b4ade210fbd7004c9aece7
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-06 8:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 18:49 [PATCH] build: unbreak bootstrap on uclinux targets [PR112762] Marek Polacek
2023-12-06 8:01 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).