diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2021-07-08 08:21:20 -0700 |
---|---|---|
committer | Sandra Loosemore <sandra@codesourcery.com> | 2021-07-27 21:20:21 -0700 |
commit | fef67987cf502fe322e92ddce22eea7ac46b4d75 (patch) | |
tree | f04b9267351ae00bf804b17be9e75e66e1cbadb7 /libgfortran/Makefile.in | |
parent | 89b3c97eed75c1e7c492bc727e0016003c5809cc (diff) |
Bind(C): Fix type encodings in ISO_Fortran_binding.h
ISO_Fortran_binding.h had many incorrect hardwired kind encodings in
the definitions of the CFI_type_* macros. Additionally, not all
targets support all the defined type encodings, and the Fortran
standard requires those macros to have a negative value.
This patch changes ISO_Fortran_binding.h to use sizeof instead of
hard-coded sizes, and assembles it from fragments that reflect the
set of types supported by the target.
2021-07-22 Sandra Loosemore <sandra@codesourcery.com>
Tobias Burnus <tobias@codesourcery.com>
libgfortran/
PR libfortran/101305
* ISO_Fortran_binding.h: Fix hard-coded sizes and split into...
* ISO_Fortran_binding-1-tmpl.h: New file.
* ISO_Fortran_binding-2-tmpl.h: New file.
* ISO_Fortran_binding-3-tmpl.h: New file.
* Makefile.am: Add rule for generating ISO_Fortran_binding.h.
Adjust pathnames to that file.
* Makefile.in: Regenerated.
* mk-kinds-h.sh: New file.
* runtime/ISO_Fortran_binding.c: Fix include path.
Diffstat (limited to 'libgfortran/Makefile.in')
-rw-r--r-- | libgfortran/Makefile.in | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in index 3d043aaa924..a7d8e11b5e4 100644 --- a/libgfortran/Makefile.in +++ b/libgfortran/Makefile.in @@ -698,6 +698,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -723,8 +724,8 @@ gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) @LIBGFOR_USE_SYMVER_FALSE@version_dep = @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)/include +gfor_c_HEADERS = ISO_Fortran_binding.h +gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/include LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \ $(lt_host_flags) @@ -1381,6 +1382,7 @@ gfor_built_src = $(i_all_c) $(i_any_c) $(i_count_c) $(i_maxloc0_c) \ $(i_pow_c) $(i_pack_c) $(i_unpack_c) $(i_matmulavx128_c) \ $(i_spread_c) selected_int_kind.inc selected_real_kind.inc kinds.h \ $(i_cshift0_c) kinds.inc c99_protos.inc fpu-target.h fpu-target.inc \ + ISO_Fortran_binding.h \ $(i_cshift1a_c) $(i_maxloc0s_c) $(i_minloc0s_c) $(i_maxloc1s_c) \ $(i_minloc1s_c) $(i_maxloc2s_c) $(i_minloc2s_c) $(i_maxvals_c) \ $(i_maxval0s_c) $(i_minval0s_c) $(i_maxval1s_c) $(i_minval1s_c) \ @@ -7040,6 +7042,16 @@ fpu-target.inc: fpu-target.h $(srcdir)/libgfortran.h grep '^#define GFC_FPE_' < $(top_srcdir)/../gcc/fortran/libgfortran.h > $@ || true grep '^#define GFC_FPE_' < $(srcdir)/libgfortran.h >> $@ || true +ISO_Fortran_binding.h: $(srcdir)/ISO_Fortran_binding-1-tmpl.h \ + $(srcdir)/ISO_Fortran_binding-2-tmpl.h \ + $(srcdir)/ISO_Fortran_binding-3-tmpl.h \ + kinds.inc + -rm -f $@ + cp $(srcdir)/ISO_Fortran_binding-1-tmpl.h $@ + $(COMPILE) -E -dD $(srcdir)/ISO_Fortran_binding-2-tmpl.h \ + | grep '^#define CFI_type' >> $@ + cat $(srcdir)/ISO_Fortran_binding-3-tmpl.h >> $@ + @MAINTAINER_MODE_TRUE@$(i_all_c): m4/all.m4 $(I_M4_DEPS2) @MAINTAINER_MODE_TRUE@ $(M4) -Dfile=$@ -I$(srcdir)/m4 all.m4 > $@ |