Bug 18469 - configure incorrectly defines gid_t
Summary: configure incorrectly defines gid_t
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on: 21481
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-13 21:01 UTC by Aaron W. LaFramboise
Modified: 2022-05-24 17:07 UTC (History)
7 users (show)

See Also:
Host: i686-pc-mingw32
Target: sparc-sun-solaris2.8
Build: i686-pc-mingw32
Known to work:
Known to fail:
Last reconfirmed: 2005-05-12 02:10:58


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron W. LaFramboise 2004-11-13 21:01:20 UTC
When building a cross compiler from a Windows host to sparc-sun-solaris2.8, 
make fails here:

/aaronwl/cs/compilers/gcc/build/solaris8-head/gcc/xgcc -
B/aaronwl/cs/compilers/gcc/build/solaris8-head/gcc/ -B/aaronwl/cs/env/solaris-
head/sparc-sun-solaris2.8/bin/ -B/aaronwl/cs/env/solaris-head/sparc-sun-
solaris2.8/lib/ -isystem /aaronwl/cs/env/solaris-head/sparc-sun-
solaris2.8/include -isystem /aaronwl/cs/env/solaris-head/sparc-sun-
solaris2.8/sys-include -O2 -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-
strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -
isystem ./include  -I. -I. -I../../../src/cvs/head/gcc/gcc -
I../../../src/cvs/head/gcc/gcc/. -I../../../src/cvs/head/gcc/gcc/../include -
I../../../src/cvs/head/gcc/gcc/../libcpp/include   -g0 -finhibit-size-
directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -
fno-unit-at-a-time -fPIC \
   -c ../../../src/cvs/head/gcc/gcc/crtstuff.c -DCRT_BEGIN \
  -o crtbegin.o
In file included from ../../../src/cvs/head/gcc/gcc/tsystem.h:93,
                 from ../../../src/cvs/head/gcc/gcc/crtstuff.c:62:
/aaronwl/cs/env/solaris-head/root/usr/include/sys/types.h:340: error: two or 
more data types in declaration specifiers
make[1]: *** [crtbegin.o] Error 1
make[1]: Leaving directory `/aaronwl/cs/compilers/gcc/build/solaris8-head/gcc'
make: *** [all-gcc] Error 2

The line in question is:
typedef uid_t   gid_t;                  /* GID type             */

However, auto-host.h defines:
/* Define to `int' if <sys/types.h> doesn't define. */
#define gid_t int

I can't figure out from config.log why this is being defined.

Removing the define for gid_t fixes this problem.

i686-pc-mingw32
Windows XP SP2 Professional
Pentium 4 1.4GHz 256MB
binutils 2.15
mingwrt 3.5
msvcrt 7.0.2600.2180
w32api 3.1
libiconv 1.9.1
GNU Make 3.80
expect 5.26
tcl 8.4
dejagnu 1.4.2.x
Misc tools and environment from Cygwin Current Fri Oct 22 01:50:41 2004
ln with softlinks disabled
host gcc 4.0.0 20041028 (experimental)
host binutils 2.15.94 20041028
host mingwrt head 20041028
host w32api head 20041028

Configured with: ../../src/cvs/head/gcc/configure --
prefix=/aaronwl/cs/env/solaris-head --target=sparc-sun-solaris2.8 --disable-
nls --enable-languages=c --with-sysroot=/aaronwl/cs/env/solaris-head/root
Thread model: single
gcc version 4.0.0 20041113 (experimental)
Comment 1 Andrew Pinski 2004-11-13 21:06:26 UTC
auto-host.h should not be included in crtstuff.c at all.
Comment 2 Andrew Pinski 2005-05-12 02:10:58 UTC
depending on PR 21481 since that is the bug which is getting rid of the include of auto-host.h.
Comment 3 Kai Tietz 2013-12-16 20:09:39 UTC
Issue still exists for ia64 and cygwin/mingw targets on 4.9.

The following files are including auto-host.h header:
- config/i386/cygming-crtbegin.c
- config/i386/cygming-crtend.c
- config/i386/cygming-crtend.c
- config/i386/cygwin.S
- config/ia64/crtbegin.S
- config/ia64/crtend.S
- crtstuff.c

In config/ia64/t-ia64-elf there is a tweak for finding this include-file.

The macros required in crtstuff.c are:
- HAVE_GAS_HIDDEN
- HAVE_LD_EH_FRAME_HDR

The cygwin/mingw part uses:
- DEFAULT_USE_CXA_ATEXIT
- HAVE_LD_RO_RW_SECTION_MIXING
- HAVE_GAS_WEAK
- HAVE_GAS_CFI_SECTIONS_DIRECTIVE

The macros required in ia64 are:
- HAVE_INITFINI_ARRAY_SUPPORT
- USE_GAS_SYMVER

So a lot of infrastructure of gcc needs to be ported to libgcc for detecting and probs for ld vs. gold, and as.
Comment 4 jsm-csl@polyomino.org.uk 2013-12-17 23:26:36 UTC
On Mon, 16 Dec 2013, ktietz at gcc dot gnu.org wrote:

> The macros required in crtstuff.c are:
> - HAVE_GAS_HIDDEN
> - HAVE_LD_EH_FRAME_HDR

Various target macros used in target code as well as host code should, I 
suggest at <http://gcc.gnu.org/wiki/Top-Level_Libgcc_Migration>, be 
handled via the compiler predefining macros if -fbuilding-libgcc, with 
those predefines being used in target code instead of the macros from host 
tm.h.  (The exact list of host-side tm.h macros used in target code there 
may be out of date, but I expect it's still pretty close to what needs 
fixing to stop target code needing that host-side header.)

I suggest the same solution for configure-determined macros used by target 
code: predefine something if -fbuilding-libgcc, and use that predefine in 
target code.  That avoids duplicating the configure detection.

I definitely encourage cleaning things up in this area to improve the 
host/target separation in the build system.  I don't think any of the 
cases of target (or configure) macros used in target code are hard to fix; 
it just requires careful work on working out the right conversion for each 
of the many macros affected, making sure in every case that no files 
needing updating are missed out.
Comment 5 Eric Gallager 2020-10-15 20:02:19 UTC
(In reply to Andrew Pinski from comment #2)
> depending on PR 21481 since that is the bug which is getting rid of the
> include of auto-host.h.

that got closed as WONTFIX...
Comment 6 Jonathan Wakely 2020-10-15 20:09:35 UTC
The sparc-sun-solaris2.8 target is no logner supported. Is this an issue on supported versions of Solaris?
Comment 7 Eric Gallager 2022-05-24 14:52:57 UTC
(In reply to Jonathan Wakely from comment #6)
> The sparc-sun-solaris2.8 target is no logner supported. Is this an issue on
> supported versions of Solaris?

Hm, no reply, so, I'm guessing it isn't, and thus closing this.