[PATCH] Libraries' configure scripts should not read config-ml.in when multilib is disabled

2018-07-30 Thread John Ericson
apologies.] From 3e0e7d6e5cfdc46342fcad5fe6b24b4f47af0d87 Mon Sep 17 00:00:00 2001 Message-Id: <3e0e7d6e5cfdc46342fcad5fe6b24b4f47af0d87.1532988611.git.John.Ericson@Obsidian.Systems> From: John Ericson Date: Mon, 30 Jul 2018 18:06:02 -0400 Subject: [PATCH] multilib: Don't bother with multilib configurat

Re: [PATCH] Libraries' configure scripts should not read config-ml.in when multilib is disabled

2018-07-30 Thread John Ericson
On 07/30/18 19:48, Joseph Myers wrote: On the contrary, I think an important principle here is that non-multilib and multilib builds follow the same code paths as far as possible, with the multilib variables just set to trivial values (modulo osdirname) in the case of a non-multilib build - a non

[PATCH] Factor out `find_a_program` helper around `find_a_file`

2021-08-04 Thread John Ericson
The helper is for `--print-prog-name` and similar things. Since all executable finding goes through it, we can move the default overrides into that path too. This also ensures that if some is looking for a *non*-program that called `as`, `ld`, etc., weird things don't happen. --- gcc/gcc.c | 59 ++

Re: Optional machine prefix for programs in for -B dirs

2021-08-17 Thread John Ericson
OK I have polished off my code in light of previous discussion and will submit it in follow-up emails. As mentioned before, this patch series is on top of the non-behavior-changing cleanup I previously submitted in https://gcc.gnu.org/pipermail/gcc-patches/2021-August/576725.html The first patch

[PATCH 3/3] find_a_program: Only search for prefixed paths in undisambiguated dirs

2021-08-17 Thread John Ericson
This means, we might search for: - path/$machine/$version/prog - path/$machine/prog - path/$machine-prog But not - path/$machine/$version/$machine-prog because disambiguating $machine twice is unnecessary. This does mean we less liberal in what we accept than LLVM, but that's OK. The down side

[PATCH 1/3] find_a_program: First search with machine prefix

2021-08-17 Thread John Ericson
This matches the behavior of Clang, and makes it easier to work with cross compilers without heeding to hard-code paths at build time. --- gcc/gcc.c | 78 --- 1 file changed, 68 insertions(+), 10 deletions(-) diff --git a/gcc/gcc.c b/gcc/gcc.c i

[PATCH 2/3] driver: for_each_pass: Pass to callback whether dir is machine-disambiguated

2021-08-17 Thread John Ericson
We will use this in the subsequent diff to control what basenames we search for. In machine-specific subdirectories, we should just look for the original basename, but in machine-agnostic subdirectories, we might additionally look for prefixed disambiguated names, as an alternate method of keeping

[PATCH v2] Allow explicitly specifying the thread model for runtime libs

2021-08-21 Thread John Ericson
Previously, they always scraped the thread mode from `$CC -v', now, that is the default but one may pass `--with-threads=MODEL` to be explicit instead. One use-case is bootstraping with a shorter critical path. The traditionally route was to build an entire "static stage" GCC, build libc, and then

[PATCH] Factor out thread model detection with `GCC_AC_THREAD_MODEL`

2025-07-13 Thread John Ericson
From: John Ericson This macro deduplicates the $CC -v 2>&1 | sed -n 's/^Thread model: //p' check that was occurring in various runtime libs. Additionally, as a bit of an Easter egg, this also allows overriding what the compiler would return by setting the `gcc_cv_target_t

Re: [PATCH] Allow explicitly specifying the thread model for runtime libs

2025-07-13 Thread John Ericson
at 11:02 AM, John Ericson wrote: > Hello, this 4-year-old patch of mine was never reviewed. Per > https://github.com/NixOS/nixpkgs/pull/414299, we in a package set / distro, > Nixpkgs/NixOS, just began (albeit on an experimental basis) packaging GCC > with this patch (among others)

Re: [PATCH] Allow explicitly specifying the thread model for runtime libs

2025-07-11 Thread John Ericson
there, so a good one to start with. (I think it would be unnecessary complicated to discuss them all at once.) Thanks in advance, John On Wed, Aug 18, 2021, at 4:38 PM, John Ericson wrote: > From: John Ericson > > Previously, they always scraped the thread mode from `$CC -v', now,

[PATCH] libgcc/Makefile.in: Delete `MACHMODE_H` def

2025-07-15 Thread John Ericson
This dates back to the creation of top-level `libgcc` in fa9585134f6f58fa0d3da3ca4ad5493855aea2dc. I strongly suspect that this does nothing. (For context, my overall goal here is hoping libgcc can depend on fewer/no stuff that is generated by `gcc/Makefile`. This is me trying to pluck some low-ha

[PATCH v2] libgcc/Makefile.in: Delete dead `MACHMODE_H` variable

2025-07-16 Thread John Ericson
This dates back to the creation of top-level `libgcc` in fa9585134f6f58fa0d3da3ca4ad5493855aea2dc. I strongly suspect that this does nothing. Andrew Pinksi adds: > So looking into this further, MACHMODE_H used part of LIBGCC_DEPS > because of TM_H and r0-78222-gfa9585134f6f58 moved away from incl

[PATCH v3] Factor out thread model detection with new `GCC_AC_THREAD_MODEL` macro

2025-07-16 Thread John Ericson
This macro deduplicates the $CC -v 2>&1 | sed -n 's/^Thread model: //p' check that was occurring in various runtime libs. Additionally, as a bit of an Easter egg, this also allows overriding what the compiler would return by setting the `gcc_cv_target_thread_file` cache variable first. I adm

[PATCH v2] Move NO_PIE_CFLAGS logic from gcc to libgcc

2025-07-16 Thread John Ericson
From: John Ericson My goal is to be able to build libgcc cleanly in isolation --- today one needs to figure `make ...` misc things in the gcc subdir. Following Andrew Pinski's suggestions in https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, this commit moves the NO_PIE_C

[PATCH 1/2] Move NO_PIE_CFLAGS logic from gcc to libgcc

2025-07-16 Thread John Ericson
From: John Ericson My goal is to be able to build libgcc cleanly in isolation --- today one needs to figure `make ...` misc things in the gcc subdir. Following Andrew Pinski's suggestions in https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, this commit moves the NO_PIE_C

[PATCH 2/2] libgcc: Dont use TARGET_SYSTEM_ROOT from gcc

2025-07-16 Thread John Ericson
From: John Ericson Following Andrew Pinski's suggestions in https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, just use the output of: $(CC) -print-sysroot It is just used in one spot, in an AIX code-path. I just made (within make) a shell variable to use instead. I

[PATCH v3 1/2] Move NO_PIE_CFLAGS logic from gcc to libgcc

2025-07-16 Thread John Ericson
From: John Ericson My goal is to be able to build libgcc cleanly in isolation --- today one needs to figure `make ...` misc things in the gcc subdir. Following Andrew Pinski's suggestions in https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, this commit moves the NO_PIE_C

[PATCH v3 2/2] libgcc: Dont use TARGET_SYSTEM_ROOT from gcc

2025-07-16 Thread John Ericson
From: John Ericson Following Andrew Pinski's suggestions in https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, just use the output of: $(CC) -print-sysroot It is just used in one spot, in an AIX code-path. I just made (within make) a shell variable to use instead. I

[PATCH] Use regular libdir/includedir in libgcc Makefiles

2025-07-17 Thread John Ericson
* Makefile.in: Use regular libdir/includedir, no more libsubdir etc. * config/t-slibgcc-vms: Use regular libdir, no more libsubdir. * configure: Regenerate. * configure.ac: Stash away the passed libdir as orig_libdir, and define libdir and includedir to matc

[PATCH] Use regular libdir/includedir in libssp Makefiles

2025-07-20 Thread John Ericson
libdir as orig_libdir, and define libdir and includedir to match what Makefile.in used to do. Signed-off-by: John Ericson --- libssp/Makefile.am | 6 +-- libssp/Makefile.in | 113 +--- libssp/configure| 12 +++-- libssp/configure.ac

Re: [PATCH] Use regular libdir/includedir in libgcc Makefiles

2025-08-02 Thread John Ericson
> and "get those settings passed down from top level" is one plausible end > state - sharing logic implicitly that way rather than expanding it all > locally in each target library configure script, even if expanding it > locally for each library is useful as an intermediate stage.) Correct m

Re: [PATCH] Use regular libdir/includedir in libgcc Makefiles

2025-08-04 Thread John Ericson
On Mon, Aug 4, 2025, at 4:02 PM, Joseph Myers wrote: > On Sun, 3 Aug 2025, John Ericson wrote: > > > > and "get those settings passed down from top level" is one plausible > > > end state - sharing logic implicitly that way rather than expanding it > &

Re: [PATCH] Use regular libdir/includedir in libgcc Makefiles

2025-08-05 Thread John Ericson
On Tue, Aug 5, 2025, at 5:15 PM, Joseph Myers wrote: > On Tue, 5 Aug 2025, John Ericson wrote: > > > > That's unavoidable to some extent, given that the GCC libraries have > > > additional concepts for installation directories (such as a directory for > &

[PATCH] Get rid of `with_multisrctop`

2025-08-05 Thread John Ericson
I can't quite tell, but I have a nagging suspicion that this is unused. It would be nice to simplify some of the multilib stuff, and the complexity around source directory (rather than build directory) handling seems like it ought not to be so necessary. This also nicely fixes a "fixme" about the

[PATCH v2 3/3] find_a_program: Only search for prefixed paths in undisambiguated dirs

2025-08-05 Thread John Ericson
er added in the previous commit to implement the above logic. Signed-off-by: John Ericson --- gcc/gcc.cc | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/gcc/gcc.cc b/gcc/gcc.cc index 81025d4fafe..e98a67fdaec 100644 --- a/gcc/gcc.cc +

[PATCH v2 1/3] find_a_program: First search with machine prefix

2025-08-05 Thread John Ericson
file_at_path, just as find_a_file uses file_at_path. (driver::set_up_specs): Initial just_machine_prefix, a constant used above. Signed-off-by: John Ericson --- gcc/gcc.cc | 76 +++--- 1 file changed, 66 insertions(+), 10 deletions(-) diff

[PATCH v2 2/3] driver: for_each_pass: Pass to callback whether dir is machine-disambiguated

2025-08-05 Thread John Ericson
unused paramter to match new callback type. Signed-off-by: John Ericson --- gcc/gcc.cc | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gcc/gcc.cc b/gcc/gcc.cc index d3ba4d6565b..81025d4fafe 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc @@ -2783,7 +2783,7

[PATCH v4] Move NO_PIE_CFLAGS logic from gcc to libgcc

2025-07-30 Thread John Ericson
make variable via autoconf substitution. * configure: Regenerate. * configure.ac: New configure check to define NO_PIE_CFLAGS using the algorithm Andrew asked for in the linked mail. Suggested-by: Andrew Pinski Signed-off-by: John Ericson --- gcc/Makefile.in

[PATCH v4] Factor out thread model detection with new `GCC_AC_THREAD_MODEL` macro

2025-07-30 Thread John Ericson
This macro deduplicates the $CC -v 2>&1 | sed -n 's/^Thread model: //p' check that was occurring in various runtime libs. Additionally, as a bit of an Easter egg, this also allows overriding what the compiler would return by setting the `gcc_cv_target_thread_file` cache variable first. I adm

[PATCH v2] driver: Rework for_each_path using C++

2025-08-13 Thread John Ericson
back on the above class which inherited its name. (do_spec_1): Updated to use new spec_path. Signed-off-by: John Ericson --- gcc/gcc.cc | 126 + 1 file changed, 68 insertions(+), 58 deletions(-) diff --git a/gcc/gcc.cc b/gcc/g

[PATCH v2 2/2] driver: `add_to_obstack` and `find_a_file` redo with lambdas

2025-08-13 Thread John Ericson
A follow-up from "driver: Rework for_each_path using C++" These types are, for all intents and purposes, single-use closure environment types. It is much more ergonomic to juse use lambdas for this. On IRC there was concern about static dispatch and compile times with lambdas, but I have kept the

Re: [PATCH] Get rid of `with_multisrctop`

2025-08-06 Thread John Ericson
I think upon further reflection, I have a slightly different read of what's going on. See also https://gcc.gnu.org/legacy-ml/gcc/2005-07/msg00236.html / https://www.airs.com/ian/configure/configure_8.html (rendering of since-deleted from the GDB repo item referenced in reply), which I also foun

[PATCH v3 1/4] find_a_program: Separate from find_a_file

2025-08-06 Thread John Ericson
From: John Ericson This continues what I started in way back in 5fee8a0a9223d030c66d53c104fb0a431369248f --- there is no executable-specific logic cluttering up find_a_file either, but instead there is a clean separation. The cost of this is that there is now some code duplication, but in

[PATCH v3 2/4] driver: Remove the mode field from `file_at_path_info`

2025-08-06 Thread John Ericson
_file call. Signed-off-by: John Ericson --- gcc/gcc.cc | 35 --- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/gcc/gcc.cc b/gcc/gcc.cc index 3e1e4bbd866..ca73aea90bd 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc @@ -387,7 +387,7 @@ static void xputenv (

[PATCH] driver: Rework for_each_path using C++

2025-08-06 Thread John Ericson
(spec_path): Became the callback on the above class which inherited its name. (do_spec_1): Updated to use new spec_path. Signed-off-by: John Ericson --- gcc/gcc.cc | 485 ++--- 1 file changed, 242 insertions(+), 243 deletions(-) dif

Re: [PATCH v2 1/3] find_a_program: First search with machine prefix

2025-08-06 Thread John Ericson
is no longer mentioned at the beginning of the motivation :). Cheers, John On Wed, Aug 6, 2025, at 12:57 AM, Andrew Pinski wrote: > On Tue, Aug 5, 2025 at 9:54 PM Andrew Pinski wrote: > > > > On Tue, Aug 5, 2025 at 9:50 PM John Ericson wrote: > > > > > > This m

[PATCH v3 3/4] for_each_pass: Pass to callback whether dir is machine-disambiguated

2025-08-06 Thread John Ericson
From: John Ericson We will use this in the subsequent patch to control what filenames we search for. gcc/ChangeLog: * gcc.cc (for_each_path): Pass an additional boolean argument to the callback specifying whether the current directly being searched is machine-specific

[PATCH v3 4/4] find_a_program: Search with machine prefix in some cases

2025-08-06 Thread John Ericson
From: John Ericson Prefatory note: I've since learned that this quite similar to https://inbox.sourceware.org/gcc-patches/20240522095404.1825269-1-...@gcc.gnu.org/, postdating my original patch series, but predating this version. See that thread for additional motivation. That patch upda

Re: [PATCH] Get rid of `with_multisrctop`

2025-08-08 Thread John Ericson
u, 7 Aug 2025, John Ericson wrote: > > > The VPATH workaround however is akin to: > > > > mkdir -p $build/mach0/mach1/libgcc > > cd $build/mach0/mach1/libgcc > > ln -s $gcc_source/libgcc/* ./ > > ./configure > > > > and it's that --- using

Re: [PATCH] Get rid of `with_multisrctop`

2025-08-07 Thread John Ericson
On Thu, Aug 7, 2025, at 3:21 PM, Joseph Myers wrote: > On Thu, 7 Aug 2025, John Ericson wrote: > > > I think upon further reflection, I have a slightly different read of > > what's going on. > > > > See also https://gcc.gnu.org/legacy-ml/gcc/2005-07/msg00236.h

Re: [PATCH v4] Factor out thread model detection with new `GCC_AC_THREAD_MODEL` macro

2025-08-21 Thread John Ericson
On Thu, Jul 31, 2025, at 6:08 PM, Joseph Myers wrote: > OK in the absence of build machinery maintainer objections within the next > week. Checking in on a few of these (this will be one of a few emails). I believe it is has been a few weeks of no objections now? John

Re: [PATCH v4] Move NO_PIE_CFLAGS logic from gcc to libgcc

2025-08-21 Thread John Ericson
On Thu, Jul 31, 2025, at 6:03 PM, Joseph Myers wrote: > OK in the absence of libgcc or build machinery maintainer objections > within the next week. Checking in on a few of these (this will be one of a few emails). I believe it is has been a few weeks of no objections now? John

Re: [PATCH v3 2/2] libgcc: Dont use TARGET_SYSTEM_ROOT from gcc

2025-08-21 Thread John Ericson
On Wed, Jul 30, 2025, at 5:52 PM, Joseph Myers wrote: > OK in the absence of AIX maintainer objections within the next week. Checking in on a few of these (this will be one of a few emails). I believe it is has been a few weeks of no objections now? John

[PATCH v3 1/2] driver: Rework for_each_path using C++

2025-08-20 Thread John Ericson
back on the above class which inherited its name. (do_spec_1): Updated to use new spec_path. Signed-off-by: John Ericson --- gcc/gcc.cc | 128 + 1 file changed, 70 insertions(+), 58 deletions(-) diff --git a/gcc/gcc.cc b/gcc/g

Re: [PATCH v2 2/2] driver: `add_to_obstack` and `find_a_file` redo with lambdas

2025-08-20 Thread John Ericson
build and that linked and run fine. On Wed, Aug 20, 2025, at 11:05 PM, Jason Merrill wrote: > On 8/13/25 2:48 PM, John Ericson wrote: > > A follow-up from "driver: Rework for_each_path using C++" > > > > These types are, for all intents and purposes, single-use closu

[PATCH v3 2/2] driver: `add_to_obstack` and `find_a_file` redo with lambdas

2025-08-20 Thread John Ericson
for lambda (build_search_list): Use for_each_path with lambda. (find_a_file): Use for_each_path with lambda. Signed-off-by: John Ericson --- gcc/gcc.cc | 142 + 1 file changed, 66 insertions(+), 76 deletions(-) diff --git a/gcc/gc

[PATCH v3 3/3] driver: Rework for_each_path without OOP

2025-08-20 Thread John Ericson
From: John Ericson This time use no classes, virtual methods. Just use higher order functions using templates. Now it's even shorter than before --- which is also shorter than the no-lambda, pure OOP original --- but at the cost of some overkill template specialization. Here are the

Re: [PATCH v3 2/4] driver: Remove the mode field from `file_at_path_info`

2025-08-22 Thread John Ericson
it makes some sense to separately consider 1 & 2 as a single unit, and then 3 & 4 as a single unit. John On Wed, Aug 6, 2025, at 5:44 PM, John Ericson wrote: > Now that `find_a_program` and `find_a_file` have been separated, we > don't need a mode parameter, because one is

[PATCH v4 4/4] find_a_program: Search with machine prefix in some cases

2025-08-22 Thread John Ericson
e less spooky-action-at-a-distince using C++ features, but I just matched how the corresponding suffix variable worked for now for uniformity. Signed-off-by: John Ericson --- gcc/gcc.cc | 54 +++--- 1 file changed, 39 insertions(+), 15 d

[PATCH v4 2/4] driver: Simplify `find_a_program` and `find_a_file`

2025-08-22 Thread John Ericson
From: John Ericson Now that `find_a_program` and `find_a_file` have been separated, we can make a number of simplification in both of them. Most notably, we don't need a mode parameter, because one is always doing `R_OK`, and the other is always doing `X_OK`. This change also proves that

[PATCH v4 1/4] find_a_program: Separate from find_a_file

2025-08-22 Thread John Ericson
is pure duplication (for easy reading) but the rest of the series will remove a bunch of dead code / extraneous parameters, until there is hardly any duplication. gcc/ChangeLog: * gcc.cc (find_a_program): Inline find_a_file, instead of calling. Signed-off-by: John Ericson

[PATCH v4 3/4] for_each_path: Pass to callback whether dir is machine-disambiguated

2025-08-22 Thread John Ericson
()): Add unused parameter to match new callback type. Signed-off-by: John Ericson --- gcc/gcc.cc | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/gcc.cc b/gcc/gcc.cc index 3f27c35708b..ebdbb0d2d78 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc

[PATCH v4] driver: Rework for_each_path using C++

2025-08-22 Thread John Ericson
From: John Ericson The old C-style was cumbersome make making one responsible for manually creating and passing in two parts a closure (separate function and *_info class for closed-over variables). With C++ lambdas, we can just: - derive environment types implicitly - have fewer stray static

Re: [PATCH v3 3/3] driver: Rework for_each_path without OOP

2025-08-22 Thread John Ericson
On Fri, Aug 22, 2025, at 2:35 PM, Jason Merrill wrote: > That looks fine to me. Please combine all three patches into one. Great! Also I remembered that since we're using templates now, I can also go ahead and use a polymorphic return type to get rid of a pair of void* <-> char* casts. So the

Re: GFortran broken after f23bac62f46fc296a4d0526ef54824d406c3756c

2025-09-05 Thread John Ericson
n end.f90 -o end > > > > > > >> f951: Fatal Error: Cannot open pre-included file '\xe0\xd4\xf2,' > > > > > > >> compilation terminated. > > > > > > >> > > > > > > >> From your description, it sou

[PATCH] Allow explicitly specifying the thread model for runtime libs

2021-08-18 Thread John Ericson via Gcc-patches
From: John Ericson Previously, they always scraped the thread mode from `$CC -v', now, that is the default but one may pass `--with-threads=MODEL` to be explicit instead. One use-case is bootstraping with a shorter critical path. The traditionally route was to build an entire "static