* Re: 'posix_spawnp' error in build
2023-12-25 16:28 ` Segher Boessenkool
@ 2023-12-25 16:33 ` Xi Ruoyao
2023-12-25 23:00 ` Segher Boessenkool
2023-12-25 18:26 ` Prashant
2023-12-29 22:40 ` Dave Blanchard
2 siblings, 1 reply; 7+ messages in thread
From: Xi Ruoyao @ 2023-12-25 16:33 UTC (permalink / raw)
To: Segher Boessenkool, Prashant; +Cc: gcc-help, gcc
On Mon, 2023-12-25 at 10:28 -0600, Segher Boessenkool wrote:
> Hi!
>
> On Mon, Dec 25, 2023 at 08:11:23PM +0530, Prashant via Gcc-help wrote:
> > I'm trying to build the gcc repository. Based on the instructions given on
> > the SummerOfCode - GCC Wiki (gnu.org)
> > <https://gcc.gnu.org/wiki/SummerOfCode#Before_you_apply> and GCC for New
> > Contributors — GCC Contributors Guide 0.1 documentation
> > (gcc-newbies-guide.readthedocs.io)
> > <https://gcc-newbies-guide.readthedocs.io/en/latest/>, I have tried the
> > following commands.
> >
> > 1) git clone git://gcc.gnu.org/git/gcc.git
> > 2) cd gcc & ./contrib/download_prerequisites
> > 3) mkdir objdir & cd objdir
> > 4) ../gcc/configure --prefix=/home/path/to/gcc --enable-languages=c,c++
>
> That is wrong. Build dir as a subdir of the source dir is not
> supported. It might work in many cases, but that does not mean it is
> okay to do.
It *is* supported, per discussion at
https://gcc.gnu.org/pipermail/gcc-patches/2023-November/638760.html.
But then you should use "../configure", not "../gcc/configure". Running
the configure script of a GCC component (instead of the top-level
configure) directly is completely unsupported.
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 'posix_spawnp' error in build
2023-12-25 16:33 ` Xi Ruoyao
@ 2023-12-25 23:00 ` Segher Boessenkool
2023-12-26 14:04 ` Prashant
0 siblings, 1 reply; 7+ messages in thread
From: Segher Boessenkool @ 2023-12-25 23:00 UTC (permalink / raw)
To: Xi Ruoyao; +Cc: Prashant, gcc-help, gcc
On Tue, Dec 26, 2023 at 12:33:40AM +0800, Xi Ruoyao wrote:
> On Mon, 2023-12-25 at 10:28 -0600, Segher Boessenkool wrote:
> > > 1) git clone git://gcc.gnu.org/git/gcc.git
> > > 2) cd gcc & ./contrib/download_prerequisites
> > > 3) mkdir objdir & cd objdir
> > > 4) ../gcc/configure --prefix=/home/path/to/gcc --enable-languages=c,c++
> >
> > That is wrong. Build dir as a subdir of the source dir is not
> > supported. It might work in many cases, but that does not mean it is
> > okay to do.
>
> It *is* supported, per discussion at
> https://gcc.gnu.org/pipermail/gcc-patches/2023-November/638760.html.
Huh, okay. That changed "recently" then, for some elongated timescale
anyway :-)
> But then you should use "../configure", not "../gcc/configure".
Ha! I didn't even notice that.
> Running
> the configure script of a GCC component (instead of the top-level
> configure) directly is completely unsupported.
Without all the necessary configuration arguments, yeah. So it is still
easier to just make an actually separate object dir -- even if only so
you can just blow it away when you want to start over :-)
Segher
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 'posix_spawnp' error in build
2023-12-25 23:00 ` Segher Boessenkool
@ 2023-12-26 14:04 ` Prashant
0 siblings, 0 replies; 7+ messages in thread
From: Prashant @ 2023-12-26 14:04 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: Xi Ruoyao, gcc-help, gcc
[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]
Hello,
Any solution you have in mind?
Thanks,
Prashanth
On Tue, 26 Dec 2023 at 04:32, Segher Boessenkool <segher@kernel.crashing.org>
wrote:
> On Tue, Dec 26, 2023 at 12:33:40AM +0800, Xi Ruoyao wrote:
> > On Mon, 2023-12-25 at 10:28 -0600, Segher Boessenkool wrote:
> > > > 1) git clone git://gcc.gnu.org/git/gcc.git
> > > > 2) cd gcc & ./contrib/download_prerequisites
> > > > 3) mkdir objdir & cd objdir
> > > > 4) ../gcc/configure --prefix=/home/path/to/gcc
> --enable-languages=c,c++
> > >
> > > That is wrong. Build dir as a subdir of the source dir is not
> > > supported. It might work in many cases, but that does not mean it is
> > > okay to do.
> >
> > It *is* supported, per discussion at
> > https://gcc.gnu.org/pipermail/gcc-patches/2023-November/638760.html.
>
> Huh, okay. That changed "recently" then, for some elongated timescale
> anyway :-)
>
> > But then you should use "../configure", not "../gcc/configure".
>
> Ha! I didn't even notice that.
>
> > Running
> > the configure script of a GCC component (instead of the top-level
> > configure) directly is completely unsupported.
>
> Without all the necessary configuration arguments, yeah. So it is still
> easier to just make an actually separate object dir -- even if only so
> you can just blow it away when you want to start over :-)
>
>
> Segher
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 'posix_spawnp' error in build
2023-12-25 16:28 ` Segher Boessenkool
2023-12-25 16:33 ` Xi Ruoyao
@ 2023-12-25 18:26 ` Prashant
2023-12-29 22:40 ` Dave Blanchard
2 siblings, 0 replies; 7+ messages in thread
From: Prashant @ 2023-12-25 18:26 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: gcc-help, gcc
[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]
On Mon, 25 Dec 2023 at 22:00, Segher Boessenkool <segher@kernel.crashing.org>
wrote:
> Hi!
>
> > That is wrong. Build dir as a subdir of the source dir is not
> > supported. It might work in many cases, but that does not mean it is
> > okay to do.
>
> I'm really sorry to miss out this important piece of information. Before
> the execution of step 3, I'm out of the gcc repo. So 'gcc' and 'objdir' are
> in the same level.
>
> I don't know if that is one of the weird problems caused by this. Easy
> > enough to find out. First "make distclean", and then "git status".
>
> I don't know if we require it to execute above, specially if it's outside
the actual gcc repo.
> >The error message says that the newly compiled compiler driver ("xgcc",
> > which will be insbtalled as just "gcc" eventually) cannot execute the
> > newly compiled actual C++ compiler ("cc1plus"), not from the place it
> > thinks it put it, anyway.
>
> Any solution for this> Problem still exists.
> > gl;hf, happy holidays, let us know how it went / what else you find out,
>
> Thank you and happy holidays to everyone!
> Segher
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 'posix_spawnp' error in build
2023-12-25 16:28 ` Segher Boessenkool
2023-12-25 16:33 ` Xi Ruoyao
2023-12-25 18:26 ` Prashant
@ 2023-12-29 22:40 ` Dave Blanchard
2 siblings, 0 replies; 7+ messages in thread
From: Dave Blanchard @ 2023-12-29 22:40 UTC (permalink / raw)
To: gcc
On Mon, 25 Dec 2023 10:28:14 -0600
Segher Boessenkool <segher@kernel.crashing.org> wrote:
> That is wrong. Build dir as a subdir of the source dir is not
> supported. It might work in many cases, but that does not mean it is
> okay to do.
Works perfectly fine on every version of GCC I've used, from 5 to 12, and I've done this countless times in various configurations.
If there is any kind of problem here, GCC needs to fix its junk build process, instead of being the one package on the planet requiring some absurd out-of-directory build.
> I don't know if that is one of the weird problems caused by this. Easy
> enough to find out. First "make distclean", and then "git status".
>
> The error message says that the newly compiled compiler driver ("xgcc",
> which will be insbtalled as just "gcc" eventually) cannot execute the
> newly compiled actual C++ compiler ("cc1plus"), not from the place it
> thinks it put it, anyway.
It's GNU software, so go figure.
A mysterious "No such file or directory" error here can also indicate the binary isn't finding the libc loader for some reason, due to bad rpath or some such. Use 'readelf -a' to ensure the C library loader path is correct.
Dave
^ permalink raw reply [flat|nested] 7+ messages in thread