On 03/20/2014 06:08 PM, Bernd Schmidt wrote:
This is based on Michael Zolotukhin's patch 3/3 from a while ago. It enables lto-wrapper to build target images using the offload compilers (identifying them through an env variable passed in by the gcc driver). All the target-specific code is gone, however. We now expect an offload compiler to provide a mkoffload tool to generate the image, and we just call it from lto-wrapper.
I've committed the following fix for it, which removes obsolete code that was left over from earlier versions that created image files in lto-wrapper. Thomas noticed that things weren't working if he configured for nvptx-none rather than nvptx, since the minus got converted to an underscore needlessly.
Bernd
Index: gcc/ChangeLog.gomp =================================================================== --- gcc/ChangeLog.gomp (revision 209075) +++ gcc/ChangeLog.gomp (working copy) @@ -1,5 +1,8 @@ 2014-04-04 Bernd Schmidt <ber...@codesourcery.com> + * lto-wrapper.c (replace_special_characters): Remove functions and + all calls to it. + * lto-section-names.h (OFFLOAD_VAR_TABLE_SECTION_NAME, OFFLOAD_FUNC_TABLE_SECTION_NAME): Define. * lto-wrapper.c (OFFLOAD_FUNC_TABLE_SECTION_NAME): Don't define. Index: gcc/lto-wrapper.c =================================================================== --- gcc/lto-wrapper.c (revision 209075) +++ gcc/lto-wrapper.c (working copy) @@ -418,24 +418,6 @@ prepare_target_image (const char *target } -/* Replace all special characters in array of strings with '_'. - This is needed, e.g., when we want to use a string for a symbol name. */ -static void -replace_special_characters (char **ptr, unsigned n) -{ - unsigned i, j; - const char *special_chars = "-+=/\\~`!@#$%^&*()[]{},;.:\"'"; - for (i = 0; i < n; i++) - { - char *str = ptr[i]; - for (j = 0; j < strlen (str); j++) - { - if (strchr (special_chars, str[j])) - str[j] = '_'; - } - } -} - /* The main routine dealing with openmp offloading. The routine builds a target image for each offloading target. IN_ARGC and IN_ARGV specify input files. As all of them could contain @@ -458,7 +440,6 @@ compile_images_for_openmp_targets (unsig return; num_targets = parse_env_var (target_names, &names, NULL); - replace_special_characters (names, num_targets); const char *compiler_path = getenv ("COMPILER_PATH"); if (compiler_path == NULL)