Bug 63684 - Build failure due to "Let GDB reuse GCC's parser." (srcdir==objdir)
Summary: Build failure due to "Let GDB reuse GCC's parser." (srcdir==objdir)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-29 18:14 UTC by Sasha Levin
Modified: 2024-04-01 01:12 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Build log (43.23 KB, text/plain)
2014-10-29 20:07 UTC, Sasha Levin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sasha Levin 2014-10-29 18:14:36 UTC
Hi,

I'm seeing the following build error:

n file included from ../.././libcc1/findcomp.cc:20:0:
../.././libcc1/../gcc/config.h:6:23: fatal error: auto-host.h: No such file or directory
compilation terminated.
In file included from ../.././libcc1/plugin.cc:27:0:
../.././libcc1/../gcc/config.h:6:23: fatal error: auto-host.h: No such file or directory
compilation terminated.

I've bisected it down to:

commit ab103e33b2aae243b231eba689e0b99418fa1663
Author: pmuldoon <pmuldoon@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Oct 27 17:21:42 2014 +0000

    Let GDB reuse GCC's parser.
Comment 1 Andrew Pinski 2014-10-29 18:22:28 UTC
What target?  How options did you configure GCC with?
Comment 2 Sasha Levin 2014-10-29 18:34:48 UTC
Building on x86, config options are:

./configure --prefix=/home/sasha/gcc-inst/ --with-arch=native --with-tune=native --enable-languages=c --enable-lto --enable-gold --disable-libstdcxx 
e --with-tune=native --enable-languages=c --enable-lto --enable-gold --disable-libstdcx
Comment 3 Phil Muldoon 2014-10-29 19:54:42 UTC
I am trying to replicate locally.  Do you recall at which stage (1, 2 .. etc) during the build process this occurred at?
Comment 4 Sasha Levin 2014-10-29 20:07:35 UTC
Created attachment 33846 [details]
Build log
Comment 5 Sasha Levin 2014-10-29 20:08:00 UTC
It happened very early. I've attached the full build log for reference.
Comment 6 Phil Muldoon 2014-10-29 20:44:54 UTC
I am already past that point in my build.  auto-host.h is an automatically generated file, so I am quite puzzled why in your case it has not found it.  In my case, it is in obj/gcc/auto-host.h.  I built with your parameters.

Was this a new build from a new checkout? If you updated from an existing src base, did you run make distclean over the old build?  Or just start with a new obj/ location?
Comment 7 Sasha Levin 2014-10-29 20:51:55 UTC
The built was from a clean checkout. 

auto-host.h seems to be correctly created during the build. I see this after the build failure:

$ stat host-x86_64-unknown-linux-gnu/gcc/auto-host.h 
  File: `host-x86_64-unknown-linux-gnu/gcc/auto-host.h'
  Size: 47262           Blocks: 96         IO Block: 4096   regular file
Device: fe00h/65024d    Inode: 15209562    Links: 1
Access: (0644/-rw-r--r--)  Uid: (10017/   sasha)   Gid: (10017/   sasha)
Access: 2014-10-29 15:59:10.713463956 -0400
Modify: 2014-10-29 15:59:09.677398847 -0400
Change: 2014-10-29 15:59:09.685399348 -0400
 Birth: -
Comment 8 Phil Muldoon 2014-10-29 21:49:46 UTC
I am still waiting for my build to complete the full-stages.  Meanwhile does --disable-libcc1 allow you to continue with your work?
Comment 9 Phil Muldoon 2014-10-29 22:12:58 UTC
My build is not complete with the parameters specified in the PR:

../trunk/configure --prefix=/home/pmuldoon/gdb_compile_gcc/ --with-arch=native --with-tune=native --enable-languages=c --enable-lto --enable-gold --disable-libstdcxx --with-tune=native --enable-languages=c --enable-lto --enable-gold --disable-libstdcx  && make -j9

And it built successfully.  Which is puzzling! I notice your configure was ./configure.  Was it it an in-source build (IE not building to a separate object file directory?)
Comment 10 Phil Muldoon 2014-10-29 22:13:49 UTC
Sorry I mean my "build is now complete"
Comment 11 Sasha Levin 2014-10-29 22:15:15 UTC
That's correct. I'm just building in-tree and using 'git clean -df' to reset everything back to a pristine checkout state when I need to.
Comment 12 Jakub Jelinek 2014-10-29 22:33:31 UTC
./configure isn't supported in GCC, don't do that.
Comment 13 Sasha Levin 2014-10-29 23:00:56 UTC
From "Installing GCC: Configuration" (https://gcc.gnu.org/install/configure.html):

"building where srcdir == objdir should still work, but doesn't get extensive testing"
Comment 14 Jakub Jelinek 2014-10-30 07:48:38 UTC
That is weird, because actually the objdir subdir of srcdir case is what works fine and is daily tested, and objdir == srcdir case is the problematic case that often doesn't work.
Comment 15 Phil Muldoon 2014-10-30 08:01:26 UTC
Can you try building out of tree to see if it fixes your case? IE:

mkdir obj
cd obj
../trunk/configure .....

(replace trunk with the source directory if you are using git)
Comment 16 Sasha Levin 2014-10-30 14:18:57 UTC
The build works fine if I'm using a different obj directory.
Comment 17 Andrew Pinski 2024-03-31 23:30:22 UTC
>  --disable-libstdcxx 

That also seems like a bad option to use too.
Comment 18 Andrew Pinski 2024-04-01 01:12:09 UTC
I just did a build with objdir==srcdir with `./configure` and `make -j24 ` and it worked.

It builds libcc1 in `./host-x86_64-pc-linux-gnu/libcc1` just fine too.

I have no idea when it was fixed though.