public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* glibc-2.2{8,9} multiarch build failure on x86_64 with gcc 9
@ 2019-05-01 18:25 Arvind Sankar
  2019-05-01 18:27 ` Arvind Sankar
  2019-05-01 18:36 ` Carlos O'Donell
  0 siblings, 2 replies; 5+ messages in thread
From: Arvind Sankar @ 2019-05-01 18:25 UTC (permalink / raw)
  To: gcc, libc-help

gcc 9 when configured for fortran installs ISO_Fortran_Binding.h in
	gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/include
For x86_64's 32-bit architecture support, this creates a subdirectory named 'include'
inside $(libsubdir)/32 which didn't use to exist in gcc 8.

glibc's configure script, when configured with --with-headers=, uses the
following logic to guess at gcc's internal include directories. This
failes on gcc 9 because with -m32 now we will get $(gfor_cdir) as the
return for -print-file-name=include, instead of the real directory that
contains all the include files, $(libsubdir)/include. The result is that
SYSINCLUDES is incorrectly defined and the rest of the build fails due
to missing standard include files, eg stddef.h etc.

	# if using special system headers, find out the compiler's sekrit
	# header directory and add that to the list.  NOTE: Only does the right
	# thing on a system that doesn't need fixincludes.  (Not presently a problem.)
	if test -n "$sysheaders"; then
	  SYSINCLUDES=-nostdinc
	  for d in include include-fixed; do
	    i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
	    SYSINCLUDES="$SYSINCLUDES -isystem $i"
	  done
	  SYSINCLUDES="$SYSINCLUDES \
	-isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
	  if test -n "$CXX"; then
	    CXX_SYSINCLUDES=
	    for cxxheaders in `$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
	    | sed -n -e '1,/#include/d' -e 's/^ \(\/.*\/[cg]++\)/\1/p'`; do
	      test "x$cxxheaders" != x &&
	      CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"
	    done
	  fi
	fi
	AC_SUBST(SYSINCLUDES)
	AC_SUBST(CXX_SYSINCLUDES)

I'm not sure if this is a gcc bug or a glibc bug?

Should libgfortran install in the MULTISUBDIR? That's the only include
file that goes in there, and it is installing the same include file in
all of them, so this seems unnecessary.

glibc's configure fragment above also looks extremely fragile though,
the CXX_SYSINCLUDES version looks a little more robust, should something
similar be done for SYSINCLUDES?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: glibc-2.2{8,9} multiarch build failure on x86_64 with gcc 9
  2019-05-01 18:25 glibc-2.2{8,9} multiarch build failure on x86_64 with gcc 9 Arvind Sankar
@ 2019-05-01 18:27 ` Arvind Sankar
  2019-05-01 18:36 ` Carlos O'Donell
  1 sibling, 0 replies; 5+ messages in thread
From: Arvind Sankar @ 2019-05-01 18:27 UTC (permalink / raw)
  To: gcc, libc-help

gcc 9 when configured for fortran installs ISO_Fortran_Binding.h in
	gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/include
For x86_64's 32-bit architecture support, this creates a subdirectory named 'include'
inside $(libsubdir)/32 which didn't use to exist in gcc 8.

glibc's configure script, when configured with --with-headers=, uses the
following logic to guess at gcc's internal include directories. This
failes on gcc 9 because with -m32 now we will get $(gfor_cdir) as the
return for -print-file-name=include, instead of the real directory that
contains all the include files, $(libsubdir)/include. The result is that
SYSINCLUDES is incorrectly defined and the rest of the build fails due
to missing standard include files, eg stddef.h etc.

	# if using special system headers, find out the compiler's sekrit
	# header directory and add that to the list.  NOTE: Only does the right
	# thing on a system that doesn't need fixincludes.  (Not presently a problem.)
	if test -n "$sysheaders"; then
	  SYSINCLUDES=-nostdinc
	  for d in include include-fixed; do
	    i=`$CC -print-file-name="$d"` && test "x$i" != x && test "x$i" != "x$d" &&
	    SYSINCLUDES="$SYSINCLUDES -isystem $i"
	  done
	  SYSINCLUDES="$SYSINCLUDES \
	-isystem `echo $sysheaders | sed 's/:/ -isystem /g'`"
	  if test -n "$CXX"; then
	    CXX_SYSINCLUDES=
	    for cxxheaders in `$CXX -v -S -x c++ /dev/null -o /dev/null 2>&1 \
	    | sed -n -e '1,/#include/d' -e 's/^ \(\/.*\/[cg]++\)/\1/p'`; do
	      test "x$cxxheaders" != x &&
	      CXX_SYSINCLUDES="$CXX_SYSINCLUDES -isystem $cxxheaders"
	    done
	  fi
	fi
	AC_SUBST(SYSINCLUDES)
	AC_SUBST(CXX_SYSINCLUDES)

I'm not sure if this is a gcc bug or a glibc bug?

Should libgfortran install in the MULTISUBDIR? That's the only include
file that goes in there, and it is installing the same include file in
all of them, so this seems unnecessary.

glibc's configure fragment above also looks extremely fragile though,
the CXX_SYSINCLUDES version looks a little more robust, should something
similar be done for SYSINCLUDES?

(Fix return address in email)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: glibc-2.2{8,9} multiarch build failure on x86_64 with gcc 9
  2019-05-01 18:25 glibc-2.2{8,9} multiarch build failure on x86_64 with gcc 9 Arvind Sankar
  2019-05-01 18:27 ` Arvind Sankar
@ 2019-05-01 18:36 ` Carlos O'Donell
  2019-05-01 18:48   ` Arvind Sankar
  1 sibling, 1 reply; 5+ messages in thread
From: Carlos O'Donell @ 2019-05-01 18:36 UTC (permalink / raw)
  To: Arvind Sankar, gcc, libc-help

On 5/1/19 2:24 PM, Arvind Sankar wrote:
> gcc 9 when configured for fortran installs ISO_Fortran_Binding.h in
> 	gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/include
> For x86_64's 32-bit architecture support, this creates a subdirectory named 'include'
> inside $(libsubdir)/32 which didn't use to exist in gcc 8.
This doesn't seem correct.

I would have expected the header to exist under the target name, for example:

/usr/lib/gcc/i686-redhat-linux/9/include/ISO_Fortran_binding.h

This way it doesn't conflict with other uses.

Perhaps there is enough variability in the way you build, package, and install this
that it can break in some configurations.

I think the gcc community needs to comment on this.

-- 
Cheers,
Carlos.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: glibc-2.2{8,9} multiarch build failure on x86_64 with gcc 9
  2019-05-01 18:36 ` Carlos O'Donell
@ 2019-05-01 18:48   ` Arvind Sankar
  2019-05-01 19:18     ` Arvind Sankar
  0 siblings, 1 reply; 5+ messages in thread
From: Arvind Sankar @ 2019-05-01 18:48 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: gcc, libc-help

On Wed, May 01, 2019 at 02:36:10PM -0400, Carlos O'Donell wrote:
> On 5/1/19 2:24 PM, Arvind Sankar wrote:
> > gcc 9 when configured for fortran installs ISO_Fortran_Binding.h in
> > 	gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/include
> > For x86_64's 32-bit architecture support, this creates a subdirectory named 'include'
> > inside $(libsubdir)/32 which didn't use to exist in gcc 8.
> This doesn't seem correct.
> 
> I would have expected the header to exist under the target name, for example:
> 
> /usr/lib/gcc/i686-redhat-linux/9/include/ISO_Fortran_binding.h
> 
> This way it doesn't conflict with other uses.
> 
> Perhaps there is enough variability in the way you build, package, and install this
> that it can break in some configurations.
> 
> I think the gcc community needs to comment on this.
> 
> -- 
> Cheers,
> Carlos.

To be clear, it does exist there as well (I think because the native arch has an
empty MULTISUBDIR. The breakage happens because it _also_ exists under .../9/32/include.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: glibc-2.2{8,9} multiarch build failure on x86_64 with gcc 9
  2019-05-01 18:48   ` Arvind Sankar
@ 2019-05-01 19:18     ` Arvind Sankar
  0 siblings, 0 replies; 5+ messages in thread
From: Arvind Sankar @ 2019-05-01 19:18 UTC (permalink / raw)
  To: Carlos O'Donell, Paul Thomas; +Cc: gcc, libc-help

On Wed, May 01, 2019 at 02:48:30PM -0400, Arvind Sankar wrote:
> On Wed, May 01, 2019 at 02:36:10PM -0400, Carlos O'Donell wrote:
> > On 5/1/19 2:24 PM, Arvind Sankar wrote:
> > > gcc 9 when configured for fortran installs ISO_Fortran_Binding.h in
> > > 	gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/include
> > > For x86_64's 32-bit architecture support, this creates a subdirectory named 'include'
> > > inside $(libsubdir)/32 which didn't use to exist in gcc 8.
> > This doesn't seem correct.
> > 
> > I would have expected the header to exist under the target name, for example:
> > 
> > /usr/lib/gcc/i686-redhat-linux/9/include/ISO_Fortran_binding.h
> > 
> > This way it doesn't conflict with other uses.
> > 
> > Perhaps there is enough variability in the way you build, package, and install this
> > that it can break in some configurations.
> > 
> > I think the gcc community needs to comment on this.
> > 
> > -- 
> > Cheers,
> > Carlos.
> 
> To be clear, it does exist there as well (I think because the native arch has an
> empty MULTISUBDIR. The breakage happens because it _also_ exists under .../9/32/include.

Including Paul -- looks like the file gets installed in different places
in fortran-dev branch vs trunk?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-01 19:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-01 18:25 glibc-2.2{8,9} multiarch build failure on x86_64 with gcc 9 Arvind Sankar
2019-05-01 18:27 ` Arvind Sankar
2019-05-01 18:36 ` Carlos O'Donell
2019-05-01 18:48   ` Arvind Sankar
2019-05-01 19:18     ` Arvind Sankar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).