Author: sje Date: 2010-07-01 14:05:28 -0400 (Thu, 01 Jul 2010) New Revision: 3261
Modified: trunk/configure trunk/configure.ac trunk/osprey/Makefile.gsetup.in trunk/osprey/driver/Makefile.gbase trunk/osprey/driver/opt_actions.c trunk/osprey/driver/phases.c trunk/osprey/wgen/main.c Log: This patch fixes bugs when building the osprey/instrumentation/libinstr2 library which is written in C++. C++ libraries were not getting built correctly when using the -run-build option and thus profile directed optimizations were not working. Approved by: Roy Ju Modified: trunk/configure =================================================================== --- trunk/configure 2010-07-01 09:41:09 UTC (rev 3260) +++ trunk/configure 2010-07-01 18:05:28 UTC (rev 3261) @@ -273,7 +273,7 @@ ac_subdirs_all="$ac_subdirs_all osprey/cygnus" ac_subdirs_all="$ac_subdirs_all osprey-gcc-4.2.0" -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 MACHINE_TYPE BUILD_ABI BUILD_ARCH BUILD_HOST BUILD_TARGET BUILD_OPTIMIZE BUILD_COMPILER BUILD_BOTH LIB_MACHINE_TYPE LIB_BUILD_TARGET LIB_BUILD_ABI LIB_BUILD_ARCH LIB_BUILD_HOST LIB2_MACHINE_TYPE LIB2_BUILD_TARGET LIB2_BUILD_ABI LIB2_BUILD_ARCH LIB2_BUILD_HOST BUILD_MULTILIB COMPILER_TARG_DIR TARG_INFO_NAME LIBLIST subdirs 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 MACHINE_TYPE BUILD_ABI BUILD_ARCH BUILD_HOST BUILD_TARGET BUILD_OPTIMIZE BUILD_COMPILER BUILD_BOTH LIB_MACHINE_TYPE LIB_BUILD_TARGET LIB_BUILD_ABI LIB_BUILD_ARCH LIB_BUILD_HOST LIB2_MACHINE_TYPE LIB2_BUILD_TARGET LIB2_BUILD_ABI LIB2_BUILD_ARCH LIB2_BUILD_HOST BUILD_MULTILIB COMPILER_TARG_DIR TARG_INFO_NAME GCC_CONFIGURE_TARG GCC_DIR LIBLIST subdirs LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1427,6 +1427,9 @@ # ipfec_targ_info instead of targ_info. TARG_INFO_NAME=targ_info +# Specify the GCC src directory. +GCC_DIR=osprey-gcc-4.2.0 + # LIB_* and LIB2_* variables will default to the BUILD_* variables if not # overridden in one of the case statements below so most platforms will # not have to set these. @@ -1593,6 +1596,8 @@ + + # List of configurable files to create in object directory. ac_config_files="$ac_config_files Makefile osprey/Makefile.gsetup osprey/targdir/libspin/Makefile osprey/targdir/libspin_4_2_0/Makefile osprey/targdir/include/Makefile osprey/targdir/driver/Makefile osprey/targdir/libiberty/Makefile osprey/targdir/targ_info/Makefile osprey/targdir/be/Makefile osprey/targdir/libelf/Makefile osprey/targdir/libelfutil/Makefile osprey/targdir/libdwarf/Makefile osprey/targdir/libunwindP/Makefile osprey/targdir/cg/Makefile osprey/targdir/wopt/Makefile osprey/targdir/ipl/Makefile osprey/targdir/lno/Makefile osprey/targdir/lw_inline/Makefile osprey/targdir/ipa/Makefile osprey/targdir/whirl2c/Makefile osprey/targdir/whirl2f/Makefile osprey/targdir/libcomutil/Makefile osprey/targdir/ir_tools/Makefile osprey/targdir/libcmplrs/Makefile osprey/targdir/wgen/Makefile osprey/targdir/libcif/Makefile osprey/targdir/arith/Makefile osprey/targdir/orc_ict/Makefile osprey/targdir/orc_intel/Makefile osprey/targdir/libkapi/Makefile osprey/targdir/crayf90/Makefile osprey/targdir/crayf90/fe90/Makefile osprey/targdir/crayf90/libf90sgi/Makefile osprey/targdir/crayf90/sgi/Makefile osprey/targdir/gccfe/Makefile osprey/targdir/gccfe/gnu/Makefile osprey/targdir/g++fe/Makefile osprey/targdir/g++fe/gnu/Makefile" @@ -1630,6 +1635,8 @@ subdirs="$subdirs osprey/cygnus" +# We do not use $GCC_DIR because using AC_CONFIG_SUBDIRS with variables +# breaks "configure --help=recursive". See autoconf documentation. subdirs="$subdirs osprey-gcc-4.2.0" @@ -2361,6 +2368,8 @@ s,@BUILD_MULTILIB@,$BUILD_MULTILIB,;t t s,@COMPILER_TARG_DIR@,$COMPILER_TARG_DIR,;t t s,@TARG_INFO_NAME@,$TARG_INFO_NAME,;t t +s,@GCC_CONFIGURE_TARG@,$GCC_CONFIGURE_TARG,;t t +s,@GCC_DIR@,$GCC_DIR,;t t s,@LIBLIST@,$LIBLIST,;t t s,@subdirs@,$subdirs,;t t s,@LIBOBJS@,$LIBOBJS,;t t Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2010-07-01 09:41:09 UTC (rev 3260) +++ trunk/configure.ac 2010-07-01 18:05:28 UTC (rev 3261) @@ -105,6 +105,9 @@ # ipfec_targ_info instead of targ_info. TARG_INFO_NAME=targ_info +# Specify the GCC src directory. +GCC_DIR=osprey-gcc-4.2.0 + # LIB_* and LIB2_* variables will default to the BUILD_* variables if not # overridden in one of the case statements below so most platforms will # not have to set these. @@ -266,6 +269,8 @@ AC_SUBST([BUILD_MULTILIB]) AC_SUBST([COMPILER_TARG_DIR]) AC_SUBST([TARG_INFO_NAME]) +AC_SUBST([GCC_CONFIGURE_TARG]) +AC_SUBST([GCC_DIR]) # List of configurable files to create in object directory. AC_CONFIG_FILES([ @@ -361,6 +366,8 @@ # Configure cygnus and GCC subdirectories. AC_CONFIG_SUBDIRS(osprey/cygnus) +# We do not use $GCC_DIR because using AC_CONFIG_SUBDIRS with variables +# breaks "configure --help=recursive". See autoconf documentation. AC_CONFIG_SUBDIRS(osprey-gcc-4.2.0) AC_OUTPUT Modified: trunk/osprey/Makefile.gsetup.in =================================================================== --- trunk/osprey/Makefile.gsetup.in 2010-07-01 09:41:09 UTC (rev 3260) +++ trunk/osprey/Makefile.gsetup.in 2010-07-01 18:05:28 UTC (rev 3261) @@ -87,6 +87,9 @@ ifndef BUILD_OBJ_DIR BUILD_OBJ_DIR = @abs_top_builddir@ endif +ifndef BUILD_SRC + BUILD_SRC = @abs_top_srcdir@ +endif ifndef BUILD_TOT BUILD_TOT = @abs_top_srcdir@/osprey endif @@ -135,6 +138,12 @@ ifndef TOP_BUILDDIR TOP_BUILDDIR = @abs_top_builddir@ endif +ifndef GCC_CONFIGURE_TARG + GCC_CONFIGURE_TARG = @GCC_CONFIGURE_TARG@ +endif +ifndef GCC_DIR + GCC_DIR = @GCC_DIR@ +endif # For cross compilers, there are really 3 separate variables: # the build host (machine you are building on), Modified: trunk/osprey/driver/Makefile.gbase =================================================================== --- trunk/osprey/driver/Makefile.gbase 2010-07-01 09:41:09 UTC (rev 3260) +++ trunk/osprey/driver/Makefile.gbase 2010-07-01 18:05:28 UTC (rev 3261) @@ -74,6 +74,8 @@ LCDEFS += -DKEY +LCDEFS += -DGCC_CONFIGURE_TARG=\"${GCC_CONFIGURE_TARG}\" -DGCC_DIR=\"${GCC_DIR}\" -DBUILD_SRC=\"${BUILD_SRC}\" + # Get the date of the build for perpetual licenses psc_build_date := $(shell date '+"%F/%T"') LCDEFS += -DOPEN64_BUILD_DATE='$(psc_build_date)' Modified: trunk/osprey/driver/opt_actions.c =================================================================== --- trunk/osprey/driver/opt_actions.c 2010-07-01 09:41:09 UTC (rev 3260) +++ trunk/osprey/driver/opt_actions.c 2010-07-01 18:05:28 UTC (rev 3261) @@ -1185,8 +1185,8 @@ override_phase(P_gcpp, "P_gcpp", new_path, "xgcc"); override_phase(P_gas, "P_gas", new_path, "xgcc"); override_phase(P_ld, "P_ld", new_path, "xgcc"); - override_phase(P_gcpp, "P_gcpp_plus", new_path, "g++"); - override_phase(P_ldplus, "P_ldplus", new_path, "g++"); + override_phase(P_gcpp_plus, "P_gcpp_plus", new_path, "xgcc"); + override_phase(P_ldplus, "P_ldplus", new_path, "xgcc"); override_phase(P_spin_cc1, "P_spin_cc1", new_path, "cc1"); override_phase(P_spin_cc1plus, "P_spin_cc1plus", new_path, "cc1plus"); new_path[builddir_len] = NULL; Modified: trunk/osprey/driver/phases.c =================================================================== --- trunk/osprey/driver/phases.c 2010-07-01 09:41:09 UTC (rev 3260) +++ trunk/osprey/driver/phases.c 2010-07-01 18:05:28 UTC (rev 3261) @@ -761,6 +761,28 @@ char p[PATH_BUF_LEN]; sprintf(p, "-B%s", get_phase_dir(index)); add_string(args, p); + if (index == P_gcpp_plus) { +#if defined(TARG_X8664) + if (abi == ABI_N32) + sprintf(p, "-I%s/../%s/32/libstdc++-v3/include/%s", get_phase_dir(index),GCC_CONFIGURE_TARG,GCC_CONFIGURE_TARG); + else + sprintf(p, "-I%s/../%s/libstdc++-v3/include/%s", get_phase_dir(index),GCC_CONFIGURE_TARG,GCC_CONFIGURE_TARG); +#else + sprintf(p, "-I%s/../%s/libstdc++-v3/include/%s", get_phase_dir(index),GCC_CONFIGURE_TARG,GCC_CONFIGURE_TARG); +#endif + add_string(args, p); +#if defined(TARG_X8664) || defined(TARG_NVISA) + if (abi == ABI_N32) + sprintf(p, "-I%s/../%s/32/libstdc++-v3/include", get_phase_dir(index),GCC_CONFIGURE_TARG); + else + sprintf(p, "-I%s/../%s/libstdc++-v3/include", get_phase_dir(index),GCC_CONFIGURE_TARG); +#else + sprintf(p, "-I%s/../%s/libstdc++-v3/include", get_phase_dir(index),GCC_CONFIGURE_TARG); +#endif + add_string(args, p); + sprintf(p, "-I%s/%s/libstdc++-v3/libsupc++", BUILD_SRC, GCC_DIR); + add_string(args, p); + } } // -Dfoo before user options, since user might specify -Ufoo. Bug 6874. if (option_was_seen(O_pthread)) Modified: trunk/osprey/wgen/main.c =================================================================== --- trunk/osprey/wgen/main.c 2010-07-01 09:41:09 UTC (rev 3260) +++ trunk/osprey/wgen/main.c 2010-07-01 18:05:28 UTC (rev 3261) @@ -171,11 +171,7 @@ argv = gs_s(gs_index(arg_list, 0)); char *command = Last_Pathname_Component(argv); //printf("%s\n", command); -#ifdef FE_GNU_4_2_0 - lang_cplus = !strcmp(command, "cc1plus42"); -#else - lang_cplus = !strcmp(command, "cc1plus"); -#endif + lang_cplus = !strncmp(command, "cc1plus", strlen("cc1plus")); // if not set by the command line, set default value by language if (emit_exceptions == -1) ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Open64-devel mailing list Open64-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open64-devel