[PATCH] Fix up gfor_cdir

Jakub Jelinek jakub@redhat.com
Thu May 2 08:08:00 GMT 2019


Hi!

On Wed, May 01, 2019 at 03:18:00PM -0400, Arvind Sankar wrote:
> Including Paul -- looks like the file gets installed in different places
> in fortran-dev branch vs trunk?

I agree this is a bug on both sides, on the GCC side because installing the
header which is the same on all targets in different multilib subdirs
doesn't make any sense and is inconsistent with all other headers, on the
glibc side because broken assumptions that there is just one header
directory, there can be many.

Let's just deal with the GCC side here.

We intentionally do install finclude files into $(MULTISUBDIR)/finclude,
because those are architecture specific, but for C/C++ headers want
instead to use preprocessor conditionals if possible to deal with possible
differences between targets in a single file.
Examples from other GCC libraries:
grep 'dir = .*/f\?include' lib*/Makefile.am
libgomp/Makefile.am:fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude
libgomp/Makefile.am:libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
libitm/Makefile.am:fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/finclude
libitm/Makefile.am:libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
liboffloadmic/Makefile.am:coi_inc_dir = $(top_srcdir)/include/coi
liboffloadmic/Makefile.am:libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
libquadmath/Makefile.am:libsubincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
libsanitizer/Makefile.am:sanincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include/sanitizer
libssp/Makefile.am:libsubincludedir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/include
libvtv/Makefile.am:libvtv_includedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
No idea why libitm has fincludedir when it doesn't install any finclude
files.

In the Fedora gcc 9 rpms, I'm including only the
9/include/ISO_Fortran_binding.h header and not 9/32/include/ISO_Fortran_binding.h
for quite some time and it works just fine.

Ok for trunk/9.1?

2019-05-02  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.am (gfor_cdir): Remove $(MULTISUBDIR).
	* Makefile.in: Regenerated.

--- libgfortran/Makefile.am.jj	2019-01-17 13:20:17.196206846 +0100
+++ libgfortran/Makefile.am	2019-05-02 09:44:15.558608723 +0200
@@ -31,7 +31,7 @@ version_dep =
 endif
 
 gfor_c_HEADERS = $(srcdir)/ISO_Fortran_binding.h
-gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/include
+gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
 
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
 	    $(lt_host_flags)
--- libgfortran/Makefile.in.jj	2019-01-17 13:20:12.481283311 +0100
+++ libgfortran/Makefile.in	2019-05-02 09:44:55.968959734 +0200
@@ -717,7 +717,7 @@ gcc_version := $(shell @get_gcc_base_ver
 @LIBGFOR_USE_SYMVER_GNU_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = $(srcdir)/gfortran.map
 @LIBGFOR_USE_SYMVER_SUN_TRUE@@LIBGFOR_USE_SYMVER_TRUE@version_dep = gfortran.map-sun
 gfor_c_HEADERS = $(srcdir)/ISO_Fortran_binding.h
-gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/include
+gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
 	    $(lt_host_flags)
 


	Jakub



More information about the Gcc-patches mailing list