[Bug target/112762] [14 Regression] Cannot build crosscompilers for some uclinux targets since r14-5791-g24592abd68e6ef
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112762 Marek Polacek changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #7 from Marek Polacek --- Should be fixed, sorry.
[Bug target/112762] [14 Regression] Cannot build crosscompilers for some uclinux targets since r14-5791-g24592abd68e6ef
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112762 Marek Polacek changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
[Bug target/112762] [14 Regression] Cannot build crosscompilers for some uclinux targets since r14-5791-g24592abd68e6ef
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112762 --- Comment #6 from GCC Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:e0eca4a55bd14d506708fb0396b31e7f7383160c commit r14-6220-ge0eca4a55bd14d506708fb0396b31e7f7383160c Author: Marek Polacek Date: Tue Dec 5 13:39:49 2023 -0500 build: unbreak bootstrap on uclinux targets [PR112762] 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.
[Bug target/112762] [14 Regression] Cannot build crosscompilers for some uclinux targets since r14-5791-g24592abd68e6ef
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112762 --- Comment #5 from joseph at codesourcery dot com --- The *-uclinux* targets are generally for systems without an MMU and a corresponding ABI (FLAT, FDPIC, etc.), whereas *-linux-uclibc* targets are for systems with an MMU and an associated conventional ELF ABI.
[Bug target/112762] [14 Regression] Cannot build crosscompilers for some uclinux targets since r14-5791-g24592abd68e6ef
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112762 --- Comment #4 from Andrew Pinski --- Part of the problem is *-uclinux is not matched in config.gcc where linux-protos.h/linux.o gets added: ``` *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) ... # Linux C libraries selection switch: glibc / uclibc / bionic. # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD. case $target in *linux*) tm_p_file="${tm_p_file} linux-protos.h" tmake_file="${tmake_file} t-linux" extra_objs="${extra_objs} linux.o" extra_options="${extra_options} linux.opt" ;; esac ``` As I mentioned there seems to be some misunderstanding what is the canonical form for the triplet, or is both canonical (and different?) and just need fix the usage for when uclinux is used and have them set tm_p_file/extra_objs correctly, if they use linux.h .
[Bug target/112762] [14 Regression] Cannot build crosscompilers for some uclinux targets since r14-5791-g24592abd68e6ef
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112762 --- Comment #3 from Marek Polacek --- I'm not really sure what the problem is but I wonder if this would help: --- 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
[Bug target/112762] [14 Regression] Cannot build crosscompilers for some uclinux targets since r14-5791-g24592abd68e6ef
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112762 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed||2023-11-29 --- Comment #2 from Andrew Pinski --- Confirmed. It looks like config.gcc is partly a mess when it comes to *-uclinux targets too. Is bfin*-uclinux* or bfin*-linux-uclibc* canonical form here? The later will work while the former is now broken ...
[Bug target/112762] [14 Regression] Cannot build crosscompilers for some uclinux targets since r14-5791-g24592abd68e6ef
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112762 Andrew Pinski changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org Summary|Cannot build crosscompilers |[14 Regression] Cannot |for some uclinux targets|build crosscompilers for ||some uclinux targets since ||r14-5791-g24592abd68e6ef Target Milestone|--- |14.0 --- Comment #1 from Andrew Pinski --- Almost definitely caused by r14-5791-g24592abd68e6ef .