public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Fix intelmic-mkoffload.c if the temp path contains a '-'
@ 2015-09-01 11:35 Hahnfeld, Jonas
  2015-09-01 11:46 ` Ilya Verbin
  2015-09-01 11:50 ` Jakub Jelinek
  0 siblings, 2 replies; 14+ messages in thread
From: Hahnfeld, Jonas @ 2015-09-01 11:35 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ilya Verbin, Jakub Jelinek, Kirill Yukhin

[-- Attachment #1: Type: text/plain, Size: 2035 bytes --]

Hopefully CC'ing the right people...

> -----Original Message-----
> From: Hahnfeld, Jonas
> Sent: Thursday, August 20, 2015 12:25 PM
> To: 'gcc-patches@gcc.gnu.org'
> Subject: Fix intelmic-mkoffload.c if the temp path contains a '-'
> 
> Hi all,
> 
> during my test of OpenMP 4.0 offloading features I have found a bug in
> intelmic-mkoffload.c when the temp path contains a '-'.
> objcopy will in this case replace it with a '_' which wasn't reflected in
> the original code and resulted in a link error of the symbols
> '__offload_image_intelmic_start' and '__offload_image_intelmic_end'.
> 
> This is my first contribution, so just reply if anything is wrong and I'll
> happily fix it.
> 
> Greetings,
> Jonas
> 
> --
> Jonas Hahnfeld, MATSE-Auszubildender
> 
> IT Center
> Group: High Performance Computing
> Division: Computational Science and Engineering
> RWTH Aachen University
> Seffenter Weg 23
> D 52074  Aachen (Germany)
> Hahnfeld@itc.rwth-aachen.de
> www.itc.rwth-aachen.de

From git-format-patch:

From 884b6199179e7a604474bc6a828a6861d3ff4501 Mon Sep 17 00:00:00 2001
From: Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
Date: Thu, 20 Aug 2015 12:13:55 +0200
Subject: [PATCH] Fix intelmic-mkoffload.c if the temp path contains a '-'

2015-08-20  Jonas Hahnfeld  <Hahnfeld@itc.rwth-aachen.de>

	* intelmic-mkoffload.c (prepare_target_image): Fix if the temp path
	contains a '-'.
---
 gcc/config/i386/intelmic-mkoffload.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gcc/config/i386/intelmic-mkoffload.c
b/gcc/config/i386/intelmic-mkoffload.c
index ca15868..c9327cf 100644
--- a/gcc/config/i386/intelmic-mkoffload.c
+++ b/gcc/config/i386/intelmic-mkoffload.c
@@ -460,7 +460,7 @@ prepare_target_image (const char *target_compiler, int
argc, char **argv)
   for (size_t i = 0; i <= symbol_name_len; i++)
     {
       char c = target_so_filename[i];
-      if ((c == '/') || (c == '.'))
+      if ((c == '/') || (c == '.') || (c == '-'))
 	c = '_';
       symbol_name[i] = c;
     }
-- 
1.7.1


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5868 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Fix intelmic-mkoffload.c if the temp path contains a '-'
@ 2015-08-20 10:32 Hahnfeld, Jonas
  0 siblings, 0 replies; 14+ messages in thread
From: Hahnfeld, Jonas @ 2015-08-20 10:32 UTC (permalink / raw)
  To: gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 703 bytes --]

Hi all,

during my test of OpenMP 4.0 offloading features I have found a bug in
intelmic-mkoffload.c when the temp path contains a '-'.
objcopy will in this case replace it with a '_' which wasn't reflected in
the original code and resulted in a link error of the symbols
'__offload_image_intelmic_start' and '__offload_image_intelmic_end'.

This is my first contribution, so just reply if anything is wrong and I'll
happily fix it.

Greetings,
Jonas

--
Jonas Hahnfeld, MATSE-Auszubildender

IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074  Aachen (Germany)
Hahnfeld@itc.rwth-aachen.de
www.itc.rwth-aachen.de


[-- Attachment #1.2: Fix-intelmic-mkoffload.c-if-the-temp-path-contains-a.patch --]
[-- Type: application/octet-stream, Size: 1050 bytes --]

From 884b6199179e7a604474bc6a828a6861d3ff4501 Mon Sep 17 00:00:00 2001
From: Jonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>
Date: Thu, 20 Aug 2015 12:13:55 +0200
Subject: [PATCH] Fix intelmic-mkoffload.c if the temp path contains a '-'

2015-08-20  Jonas Hahnfeld  <Hahnfeld@itc.rwth-aachen.de>

	* intelmic-mkoffload.c (prepare_target_image): Fix if the temp path
	contains a '-'.
---
 gcc/config/i386/intelmic-mkoffload.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gcc/config/i386/intelmic-mkoffload.c b/gcc/config/i386/intelmic-mkoffload.c
index ca15868..c9327cf 100644
--- a/gcc/config/i386/intelmic-mkoffload.c
+++ b/gcc/config/i386/intelmic-mkoffload.c
@@ -460,7 +460,7 @@ prepare_target_image (const char *target_compiler, int argc, char **argv)
   for (size_t i = 0; i <= symbol_name_len; i++)
     {
       char c = target_so_filename[i];
-      if ((c == '/') || (c == '.'))
+      if ((c == '/') || (c == '.') || (c == '-'))
 	c = '_';
       symbol_name[i] = c;
     }
-- 
1.7.1


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5868 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-09-07 14:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-01 11:35 Fix intelmic-mkoffload.c if the temp path contains a '-' Hahnfeld, Jonas
2015-09-01 11:46 ` Ilya Verbin
2015-09-01 11:50 ` Jakub Jelinek
2015-09-01 11:53   ` Hahnfeld, Jonas
2015-09-04 11:13   ` Hahnfeld, Jonas
2015-09-04 11:26     ` Ilya Verbin
2015-09-04 11:28       ` Hahnfeld, Jonas
2015-09-04 19:38     ` Mike Stump
2015-09-04 22:03       ` Ilya Verbin
2015-09-04 22:57         ` Mike Stump
2015-09-05  1:52           ` Ilya Verbin
2015-09-07 14:48         ` Ilya Verbin
2015-09-07 14:54           ` Jakub Jelinek
  -- strict thread matches above, loose matches on Subject: below --
2015-08-20 10:32 Hahnfeld, Jonas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).