From: Daniel Franke Date: Thu, 29 May 2008 18:21:35 +0000 (-0400) Subject: re PR target/36348 (f951 link failure on i686-apple-darwin9) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c776a6d0e4eb612ae81e31684a8c04e8f251279c;p=gcc.git re PR target/36348 (f951 link failure on i686-apple-darwin9) gcc: 2008-05-29 Daniel Franke PR target/36348 * config/darwin-f.c: New. * config/t-darwin: Added rule to build darwin-f.o. * config.gcc: Defined new variable, fortran_target_objs. (*-*-darwin*): Set fortran_target_objs. * Makefile.in: Defined new variable FORTRAN_TARGET_OBJS. * configure.ac: Substitute fortran_target_objs, set FORTRAN_TARGET_OBJS. * configure: Regenerated. gcc/fortran: 2008-05-29 Daniel Franke PR target/36348 * Make-lang.in (F95_OBJS): Added dependency on FORTRAN_TARGET_OBJS. From-SVN: r136178 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d522309a720..f4c3f5e0c2f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2008-05-29 Daniel Franke + + PR target/36348 + * config/darwin-f.c: New. + * config/t-darwin: Added rule to build darwin-f.o. + * config.gcc: Defined new variable, fortran_target_objs. + (*-*-darwin*): Set fortran_target_objs. + * Makefile.in: Defined new variable FORTRAN_TARGET_OBJS. + * configure.ac: Substitute fortran_target_objs, set + FORTRAN_TARGET_OBJS. + * configure: Regenerated. + 2008-05-29 H.J. Lu PR target/35771 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 64ea8cd834a..3e032df293f 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -970,6 +970,9 @@ C_TARGET_OBJS=@c_target_objs@ # Target specific, C++ specific object file CXX_TARGET_OBJS=@cxx_target_objs@ +# Target specific, Fortran specific object file +FORTRAN_TARGET_OBJS=@fortran_target_objs@ + # Object files for gcc driver. GCC_OBJS = gcc.o opts-common.o gcc-options.o diff --git a/gcc/config.gcc b/gcc/config.gcc index 3bef721391a..806728794f1 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -120,6 +120,9 @@ # cxx_target_objs List of extra target-dependent objects that be # linked into the C++ compiler only. # +# fortran_target_objs List of extra target-dependent objects that be +# linked into the fortran compiler only. +# # target_gtfiles List of extra source files with type information. # # xm_defines List of macros to define when compiling for the @@ -173,6 +176,7 @@ extra_gcc_objs= extra_options= c_target_objs= cxx_target_objs= +fortran_target_objs= tm_defines= xm_defines= # Set this to force installation and use of collect2. @@ -433,6 +437,7 @@ case ${target} in extra_options="${extra_options} darwin.opt" c_target_objs="darwin-c.o" cxx_target_objs="darwin-c.o" + fortran_target_objs="darwin-f.o" extra_objs="darwin.o" extra_gcc_objs="darwin-driver.o" default_use_cxa_atexit=yes diff --git a/gcc/config/darwin-f.c b/gcc/config/darwin-f.c new file mode 100644 index 00000000000..24ed674d708 --- /dev/null +++ b/gcc/config/darwin-f.c @@ -0,0 +1,60 @@ +/* Darwin support needed only by Fortran frontends. + Copyright (C) 2008 Free Software Foundation, Inc. + Contributed by Daniel Franke. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + + +/* Provide stubs for the hooks defined by darwin.h + TARGET_EXTRA_PRE_INCLUDES, TARGET_EXTRA_INCLUDES + + As both, gcc and gfortran link in incpath.o, we can not + conditionally undefine said hooks if fortran is build. + However, we can define do-nothing stubs of said hooks as + we are not interested in objc include files in Fortran. + + The hooks original purpose (see also darwin-c.c): + * darwin_register_objc_includes + Register the GNU objective-C runtime include path if STDINC. + + * darwin_register_frameworks + Register all the system framework paths if STDINC is true and setup + the missing_header callback for subframework searching if any + frameworks had been registered. */ + + +#include "ansidecl.h" + +/* Prototypes for functions below to avoid a lengthy list of includes + to achieve the same. */ +void darwin_register_objc_includes (const char *, const char *, int); +void darwin_register_frameworks (const char *, const char *, int); + + +void +darwin_register_objc_includes (const char *sysroot ATTRIBUTE_UNUSED, + const char *iprefix ATTRIBUTE_UNUSED, + int stdinc ATTRIBUTE_UNUSED) +{ +} + +void +darwin_register_frameworks (const char *sysroot ATTRIBUTE_UNUSED, + const char *iprefix ATTRIBUTE_UNUSED, + int stdinc ATTRIBUTE_UNUSED) +{ +} diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin index d43ce5068a7..b1ba53c4774 100644 --- a/gcc/config/t-darwin +++ b/gcc/config/t-darwin @@ -10,6 +10,10 @@ darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ incpath.h flags.h $(C_COMMON_H) $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin-c.c $(PREPROCESSOR_DEFINES) +darwin-f.o: $(srcdir)/config/darwin-f.c $(CONFIG_H) $(SYSTEM_H) coretypes.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/darwin-f.c $(PREPROCESSOR_DEFINES) + gt-darwin.h : s-gtype ; @true darwin-driver.o: $(srcdir)/config/darwin-driver.c \ diff --git a/gcc/configure b/gcc/configure index b2ab9a71988..e2888090372 100755 --- a/gcc/configure +++ b/gcc/configure @@ -458,7 +458,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn cxx_compat_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn cxx_compat_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN ac_ct_AR STRIP ac_ct_STRIP lt_ECHO objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' ac_subst_files='language_hooks' # Initialize some variables set by options. @@ -868,13 +868,13 @@ echo X"$0" | /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then +if test ! -r "$srcdir/$ac_unique_file"; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } @@ -883,7 +883,7 @@ if test ! -r $srcdir/$ac_unique_file; then { (exit 1); exit 1; }; } fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || +(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` @@ -14663,13 +14663,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:14657: $ac_compile\"" >&5) + (eval echo "\"\$as_me:14666: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:14660: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:14669: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:14663: output\"" >&5) + (eval echo "\"\$as_me:14672: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -15724,7 +15724,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 15718 "configure"' > conftest.$ac_ext + echo '#line 15727 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -16344,11 +16344,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16338: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16347: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16342: \$? = $ac_status" >&5 + echo "$as_me:16351: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16666,11 +16666,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16660: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16669: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16664: \$? = $ac_status" >&5 + echo "$as_me:16673: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16771,11 +16771,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16765: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16774: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16769: \$? = $ac_status" >&5 + echo "$as_me:16778: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16826,11 +16826,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16820: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16829: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16824: \$? = $ac_status" >&5 + echo "$as_me:16833: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19623,7 +19623,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19617 "configure" +#line 19626 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19723,7 +19723,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19717 "configure" +#line 19726 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -23793,6 +23793,7 @@ fi; + # Echo link setup. @@ -24641,6 +24642,7 @@ s,@xm_include_list@,$xm_include_list,;t t s,@xm_defines@,$xm_defines,;t t s,@c_target_objs@,$c_target_objs,;t t s,@cxx_target_objs@,$cxx_target_objs,;t t +s,@fortran_target_objs@,$fortran_target_objs,;t t s,@target_cpu_default@,$target_cpu_default,;t t s,@GMPLIBS@,$GMPLIBS,;t t s,@GMPINC@,$GMPINC,;t t diff --git a/gcc/configure.ac b/gcc/configure.ac index 3ac7ff53d86..77b596c6344 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3803,6 +3803,7 @@ AC_SUBST(xm_include_list) AC_SUBST(xm_defines) AC_SUBST(c_target_objs) AC_SUBST(cxx_target_objs) +AC_SUBST(fortran_target_objs) AC_SUBST(target_cpu_default) AC_SUBST_FILE(language_hooks) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4db2b229d30..5a8eb142613 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2008-05-29 Daniel Franke + + PR target/36348 + * Make-lang.in (F95_OBJS): Added dependency on FORTRAN_TARGET_OBJS. + 2008-05-29 Francois-Xavier Coudert * scanner.c (load_line): Add first_char argument. Don't call ungetc. diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in index dbbed88bd60..6acdbbefd7b 100644 --- a/gcc/fortran/Make-lang.in +++ b/gcc/fortran/Make-lang.in @@ -61,7 +61,7 @@ F95_PARSER_OBJS = fortran/arith.o fortran/array.o fortran/bbt.o \ fortran/resolve.o fortran/scanner.o fortran/simplify.o fortran/st.o \ fortran/symbol.o fortran/target-memory.o -F95_OBJS = $(F95_PARSER_OBJS) \ +F95_OBJS = $(F95_PARSER_OBJS) $(FORTRAN_TARGET_OBJS) \ fortran/convert.o fortran/dependency.o fortran/f95-lang.o \ fortran/trans.o fortran/trans-array.o fortran/trans-common.o \ fortran/trans-const.o fortran/trans-decl.o fortran/trans-expr.o \