* Re: [PATH] Intel offload library
@ 2014-07-02 11:13 Andrey Turetskiy
2014-07-21 9:46 ` Andrey Turetskiy
2014-07-30 21:26 ` Joseph S. Myers
0 siblings, 2 replies; 11+ messages in thread
From: Andrey Turetskiy @ 2014-07-02 11:13 UTC (permalink / raw)
To: joseph
Cc: Kirill Yukhin, Jakub Jelinek, Richard Henderson, Bernd Schmidt,
Richard Biener, Uros Bizjak, GCC Patches
[-- Attachment #1: Type: text/plain, Size: 416 bytes --]
> * Don't duplicate the logic for what's a hosted POSIX system; refactor it
> to a common fragment in config/ (I guess it needs to be a shell script
> fragment there rather than an actual autoconf macro, since you're using
> that logic in configure.tgt which is itself such a fragment).
I've attached the patch with changes related to the point.
Do you mean something like this?
--
Best regards,
Andrey Turetskiy
[-- Attachment #2: liboffload_config.patch --]
[-- Type: application/octet-stream, Size: 4258 bytes --]
diff --git a/config/target-posix b/config/target-posix
new file mode 100644
index 0000000..2fba066
--- /dev/null
+++ b/config/target-posix
@@ -0,0 +1,12 @@
+case "${target}" in
+ *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
+ ;;
+ *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
+ ;;
+ *-*-solaris2* | *-*-hpux11*)
+ ;;
+ *-*-darwin* | *-*-aix*)
+ ;;
+ *)
+ UNSUPPORTED=1 ;;
+ esac
diff --git a/libcilkrts/configure b/libcilkrts/configure
index 0dadbbd..5b60cd3 100644
--- a/libcilkrts/configure
+++ b/libcilkrts/configure
@@ -4873,6 +4873,7 @@ fi
# Get target configury.
. ${srcdir}/configure.tgt
+. ${srcdir}/../config/target-posix
if test -n "$UNSUPPORTED"; then
as_fn_error "Configuration ${target} is unsupported." "$LINENO" 5
fi
@@ -11057,7 +11058,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11060 "configure"
+#line 11061 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11163,7 +11164,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11166 "configure"
+#line 11167 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/libcilkrts/configure.ac b/libcilkrts/configure.ac
index fb21505..daaf6d1 100644
--- a/libcilkrts/configure.ac
+++ b/libcilkrts/configure.ac
@@ -67,6 +67,7 @@ fi
# Get target configury.
. ${srcdir}/configure.tgt
+. ${srcdir}/../config/target-posix
if test -n "$UNSUPPORTED"; then
AC_MSG_ERROR([Configuration ${target} is unsupported.])
fi
diff --git a/libcilkrts/configure.tgt b/libcilkrts/configure.tgt
index f766352..4c47c4f 100644
--- a/libcilkrts/configure.tgt
+++ b/libcilkrts/configure.tgt
@@ -41,21 +41,3 @@ case "${target}" in
UNSUPPORTED=1
;;
esac
-
-# Disable libcilkrts on non POSIX hosted systems.
-if test x$enable_libcilkrts = x ; then
- # Enable libcilkrts by default on hosted POSIX systems.
- case "${target}" in
- *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
- ;;
- *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
- ;;
- *-*-solaris2* | *-*-hpux11*)
- ;;
- *-*-darwin* | *-*-aix*)
- ;;
- *)
- UNSUPPORTED=1
- ;;
- esac
-fi
diff --git a/liboffloadmic/configure b/liboffloadmic/configure
index 1e759de..8e4d752 100755
--- a/liboffloadmic/configure
+++ b/liboffloadmic/configure
@@ -4935,6 +4935,7 @@ done
# Get target configure.
. ${srcdir}/configure.tgt
+. ${srcdir}/../config/target-posix
if test -n "$UNSUPPORTED"; then
as_fn_error "Configuration ${target} is unsupported." "$LINENO" 5
fi
@@ -11067,7 +11068,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11070 "configure"
+#line 11071 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11173,7 +11174,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11176 "configure"
+#line 11177 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/liboffloadmic/configure.ac b/liboffloadmic/configure.ac
index 8936ba2..96bd5a7 100644
--- a/liboffloadmic/configure.ac
+++ b/liboffloadmic/configure.ac
@@ -47,6 +47,7 @@ AC_CHECK_HEADERS([mm_malloc.h], [], [AC_MSG_ERROR(["Couldn't find mm_malloc.h"])
# Get target configure.
. ${srcdir}/configure.tgt
+. ${srcdir}/../config/target-posix
if test -n "$UNSUPPORTED"; then
AC_MSG_ERROR([Configuration ${target} is unsupported.])
fi
diff --git a/liboffloadmic/configure.tgt b/liboffloadmic/configure.tgt
index a522288..d139292 100644
--- a/liboffloadmic/configure.tgt
+++ b/liboffloadmic/configure.tgt
@@ -34,17 +34,3 @@ case "${target}" in
*-*-*)
UNSUPPORTED=1 ;;
esac
-
-# Disable liboffloadmic on non POSIX hosted systems.
-case "${target}" in
- *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu)
- ;;
- *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly*)
- ;;
- *-*-solaris2* | *-*-hpux11*)
- ;;
- *-*-darwin* | *-*-aix*)
- ;;
- *)
- UNSUPPORTED=1 ;;
- esac
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATH] Intel offload library
2014-07-02 11:13 [PATH] Intel offload library Andrey Turetskiy
@ 2014-07-21 9:46 ` Andrey Turetskiy
2014-07-28 7:33 ` Andrey Turetskiy
2014-07-30 21:26 ` Joseph S. Myers
1 sibling, 1 reply; 11+ messages in thread
From: Andrey Turetskiy @ 2014-07-21 9:46 UTC (permalink / raw)
To: joseph
Cc: Kirill Yukhin, Jakub Jelinek, Richard Henderson, Bernd Schmidt,
Richard Biener, Uros Bizjak, GCC Patches
Ping.
On Wed, Jul 2, 2014 at 3:13 PM, Andrey Turetskiy
<andrey.turetskiy@gmail.com> wrote:
>> * Don't duplicate the logic for what's a hosted POSIX system; refactor it
>> to a common fragment in config/ (I guess it needs to be a shell script
>> fragment there rather than an actual autoconf macro, since you're using
>> that logic in configure.tgt which is itself such a fragment).
>
> I've attached the patch with changes related to the point.
> Do you mean something like this?
>
> --
> Best regards,
> Andrey Turetskiy
--
Best regards,
Andrey Turetskiy
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATH] Intel offload library
2014-07-21 9:46 ` Andrey Turetskiy
@ 2014-07-28 7:33 ` Andrey Turetskiy
0 siblings, 0 replies; 11+ messages in thread
From: Andrey Turetskiy @ 2014-07-28 7:33 UTC (permalink / raw)
To: joseph
Cc: Kirill Yukhin, Jakub Jelinek, Richard Henderson, Bernd Schmidt,
Richard Biener, Uros Bizjak, GCC Patches
Ping.
On Mon, Jul 21, 2014 at 1:25 PM, Andrey Turetskiy
<andrey.turetskiy@gmail.com> wrote:
> Ping.
>
> On Wed, Jul 2, 2014 at 3:13 PM, Andrey Turetskiy
> <andrey.turetskiy@gmail.com> wrote:
>>> * Don't duplicate the logic for what's a hosted POSIX system; refactor it
>>> to a common fragment in config/ (I guess it needs to be a shell script
>>> fragment there rather than an actual autoconf macro, since you're using
>>> that logic in configure.tgt which is itself such a fragment).
>>
>> I've attached the patch with changes related to the point.
>> Do you mean something like this?
>>
>> --
>> Best regards,
>> Andrey Turetskiy
>
>
>
> --
> Best regards,
> Andrey Turetskiy
--
Best regards,
Andrey Turetskiy
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATH] Intel offload library
2014-07-02 11:13 [PATH] Intel offload library Andrey Turetskiy
2014-07-21 9:46 ` Andrey Turetskiy
@ 2014-07-30 21:26 ` Joseph S. Myers
2014-08-12 6:59 ` Andrey Turetskiy
1 sibling, 1 reply; 11+ messages in thread
From: Joseph S. Myers @ 2014-07-30 21:26 UTC (permalink / raw)
To: Andrey Turetskiy
Cc: Kirill Yukhin, Jakub Jelinek, Richard Henderson, Bernd Schmidt,
Richard Biener, Uros Bizjak, GCC Patches
On Wed, 2 Jul 2014, Andrey Turetskiy wrote:
> > * Don't duplicate the logic for what's a hosted POSIX system; refactor it
> > to a common fragment in config/ (I guess it needs to be a shell script
> > fragment there rather than an actual autoconf macro, since you're using
> > that logic in configure.tgt which is itself such a fragment).
>
> I've attached the patch with changes related to the point.
> Do you mean something like this?
Yes, something like that. Obviously post it in its own thread with a
subject line explaining what the specific patch does.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATH] Intel offload library
2014-07-30 21:26 ` Joseph S. Myers
@ 2014-08-12 6:59 ` Andrey Turetskiy
2014-08-19 8:45 ` Kirill Yukhin
0 siblings, 1 reply; 11+ messages in thread
From: Andrey Turetskiy @ 2014-08-12 6:59 UTC (permalink / raw)
To: Joseph S. Myers
Cc: Kirill Yukhin, Jakub Jelinek, Richard Henderson, Bernd Schmidt,
Richard Biener, Uros Bizjak, GCC Patches
All remarks from
https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02166.html are fixed.
Updated version of liboffloadmic you can find in GIT branch
kyukhin/gomp4-offload:
https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/kyukhin/gomp4-offload.
Commit: HEAD~3 ("Add liboffloadmic with offloading emulator").
On Thu, Jul 31, 2014 at 1:00 AM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Wed, 2 Jul 2014, Andrey Turetskiy wrote:
>
>> > * Don't duplicate the logic for what's a hosted POSIX system; refactor it
>> > to a common fragment in config/ (I guess it needs to be a shell script
>> > fragment there rather than an actual autoconf macro, since you're using
>> > that logic in configure.tgt which is itself such a fragment).
>>
>> I've attached the patch with changes related to the point.
>> Do you mean something like this?
>
> Yes, something like that. Obviously post it in its own thread with a
> subject line explaining what the specific patch does.
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
--
Best regards,
Andrey Turetskiy
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATH] Intel offload library
2014-08-12 6:59 ` Andrey Turetskiy
@ 2014-08-19 8:45 ` Kirill Yukhin
2014-08-26 6:42 ` Andrey Turetskiy
0 siblings, 1 reply; 11+ messages in thread
From: Kirill Yukhin @ 2014-08-19 8:45 UTC (permalink / raw)
To: Andrey Turetskiy
Cc: Joseph S. Myers, Jakub Jelinek, Richard Henderson, Bernd Schmidt,
Richard Biener, Uros Bizjak, GCC Patches
Hello,
On 12 Aug 10:58, Andrey Turetskiy wrote:
> All remarks from
> https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02166.html are fixed.
> Updated version of liboffloadmic you can find in GIT branch
> kyukhin/gomp4-offload:
> https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/kyukhin/gomp4-offload.
> Commit: HEAD~3 ("Add liboffloadmic with offloading emulator").
Is it ok for trunk now?
--
Thanks, K
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATH] Intel offload library
2014-08-19 8:45 ` Kirill Yukhin
@ 2014-08-26 6:42 ` Andrey Turetskiy
2014-09-04 7:41 ` Andrey Turetskiy
0 siblings, 1 reply; 11+ messages in thread
From: Andrey Turetskiy @ 2014-08-26 6:42 UTC (permalink / raw)
To: Kirill Yukhin
Cc: Joseph S. Myers, Jakub Jelinek, Richard Henderson, Bernd Schmidt,
Richard Biener, Uros Bizjak, GCC Patches
Ping.
On Tue, Aug 19, 2014 at 12:45 PM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
> Hello,
> On 12 Aug 10:58, Andrey Turetskiy wrote:
>> All remarks from
>> https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02166.html are fixed.
>> Updated version of liboffloadmic you can find in GIT branch
>> kyukhin/gomp4-offload:
>> https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/kyukhin/gomp4-offload.
>> Commit: HEAD~3 ("Add liboffloadmic with offloading emulator").
> Is it ok for trunk now?
>
> --
> Thanks, K
--
Best regards,
Andrey Turetskiy
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATH] Intel offload library
2014-08-26 6:42 ` Andrey Turetskiy
@ 2014-09-04 7:41 ` Andrey Turetskiy
2014-09-10 6:28 ` Andrey Turetskiy
0 siblings, 1 reply; 11+ messages in thread
From: Andrey Turetskiy @ 2014-09-04 7:41 UTC (permalink / raw)
To: Kirill Yukhin
Cc: Joseph S. Myers, Jakub Jelinek, Richard Henderson, Bernd Schmidt,
Richard Biener, Uros Bizjak, GCC Patches
Ping.
On Tue, Aug 26, 2014 at 10:41 AM, Andrey Turetskiy
<andrey.turetskiy@gmail.com> wrote:
> Ping.
>
> On Tue, Aug 19, 2014 at 12:45 PM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
>> Hello,
>> On 12 Aug 10:58, Andrey Turetskiy wrote:
>>> All remarks from
>>> https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02166.html are fixed.
>>> Updated version of liboffloadmic you can find in GIT branch
>>> kyukhin/gomp4-offload:
>>> https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/kyukhin/gomp4-offload.
>>> Commit: HEAD~3 ("Add liboffloadmic with offloading emulator").
>> Is it ok for trunk now?
>>
>> --
>> Thanks, K
>
>
>
> --
> Best regards,
> Andrey Turetskiy
--
Best regards,
Andrey Turetskiy
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATH] Intel offload library
2014-09-04 7:41 ` Andrey Turetskiy
@ 2014-09-10 6:28 ` Andrey Turetskiy
0 siblings, 0 replies; 11+ messages in thread
From: Andrey Turetskiy @ 2014-09-10 6:28 UTC (permalink / raw)
To: Kirill Yukhin
Cc: Joseph S. Myers, Jakub Jelinek, Richard Henderson, Bernd Schmidt,
Richard Biener, Uros Bizjak, GCC Patches
Ping.
On Thu, Sep 4, 2014 at 11:41 AM, Andrey Turetskiy
<andrey.turetskiy@gmail.com> wrote:
> Ping.
>
> On Tue, Aug 26, 2014 at 10:41 AM, Andrey Turetskiy
> <andrey.turetskiy@gmail.com> wrote:
>> Ping.
>>
>> On Tue, Aug 19, 2014 at 12:45 PM, Kirill Yukhin <kirill.yukhin@gmail.com> wrote:
>>> Hello,
>>> On 12 Aug 10:58, Andrey Turetskiy wrote:
>>>> All remarks from
>>>> https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02166.html are fixed.
>>>> Updated version of liboffloadmic you can find in GIT branch
>>>> kyukhin/gomp4-offload:
>>>> https://gcc.gnu.org/git/?p=gcc.git;a=shortlog;h=refs/heads/kyukhin/gomp4-offload.
>>>> Commit: HEAD~3 ("Add liboffloadmic with offloading emulator").
>>> Is it ok for trunk now?
>>>
>>> --
>>> Thanks, K
>>
>>
>>
>> --
>> Best regards,
>> Andrey Turetskiy
>
>
>
> --
> Best regards,
> Andrey Turetskiy
--
Best regards,
Andrey Turetskiy
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATH] Intel offload library
@ 2014-06-26 13:34 Kirill Yukhin
2014-06-26 21:27 ` Joseph S. Myers
0 siblings, 1 reply; 11+ messages in thread
From: Kirill Yukhin @ 2014-06-26 13:34 UTC (permalink / raw)
To: Jakub Jelinek, Richard Henderson, bernds, Richard Biener, Uros Bizjak
Cc: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 5711 bytes --]
Hello,
This patch adds Intel MIC runtime offload library to GCC source tree.
Patch attached (it is big, so compressed).
As proposed, name was changed (to liboffloadmic).
Bootstrap pass.
This library builds only on x86{_64} POSIX systems.
By default build is switched off.
To build it you need to pass to top-level configure: --enable-liboffloadmic={host|target}
This sources include liboffloadmic underlying software stack emulator.
It builds along with liboffloadmic (target and host correspondingly).
Is it ok for trunk?
ChangeLog/
* configure.ac: Added liboffloadmic to target binaries. Also, restrict
liboffloadmic for POSIX and i*86, and x86_64 architectures. Also added
liboffloadmic to noconfig list when C++ is not supported.
* configure: Regenerate.
* Makefile.def: Add liboffloadmic to target_modules. Make
liboffloadmic depend on libgomp's configure, libstdc++ and libgcc.
* Makefile.in: Regenerate.
* liboffloadmic/Makefile.am: New file.
* liboffloadmic/Makefile.in: Ditto.
* liboffloadmic/aclocal.m4: Ditto.
* liboffloadmic/configure: Ditto.
* liboffloadmic/configure.ac: Ditto.
* liboffloadmic/configure.tgt: Ditto.
* liboffloadmic/doc/doxygen/config: Ditto.
* liboffloadmic/doc/doxygen/header.tex: Ditto.
* liboffloadmic/include/coi/common/COIEngine_common.h: Ditto.
* liboffloadmic/include/coi/common/COIMacros_common.h: Ditto.
* liboffloadmic/include/coi/common/COIPerf_common.h : Ditto.
* liboffloadmic/include/coi/common/COIResult_common.h : Ditto.
* liboffloadmic/include/coi/common/COITypes_common.h: Ditto.
* liboffloadmic/include/coi/sink/COIBuffer_sink.h: Ditto.
* liboffloadmic/include/coi/sink/COIPipeline_sink.h: Ditto.
* liboffloadmic/include/coi/sink/COIProcess_sink.h: Ditto.
* liboffloadmic/include/coi/source/COIBuffer_source.h: Ditto.
* liboffloadmic/include/coi/source/COIEngine_source.h: Ditto.
* liboffloadmic/include/coi/source/COIEvent_source.h: Ditto.
* liboffloadmic/include/coi/source/COIPipeline_source.h: Ditto.
* liboffloadmic/include/coi/source/COIProcess_source.h: Ditto.
* liboffloadmic/include/myo/myo.h: Ditto.
* liboffloadmic/include/myo/myoimpl.h: Ditto.
* liboffloadmic/include/myo/myotypes.h: Ditto.
* liboffloadmic/liboffloadmic.spec.in: Ditto.
* liboffloadmic/runtime/cean_util.cpp: Ditto.
* liboffloadmic/runtime/cean_util.h: Ditto.
* liboffloadmic/runtime/coi/coi_client.cpp: Ditto.
* liboffloadmic/runtime/coi/coi_client.h: Ditto.
* liboffloadmic/runtime/coi/coi_server.cpp: Ditto.
* liboffloadmic/runtime/coi/coi_server.h: Ditto.
* liboffloadmic/runtime/compiler_if_host.cpp: Ditto.
* liboffloadmic/runtime/compiler_if_host.h: Ditto.
* liboffloadmic/runtime/compiler_if_target.cpp: Ditto.
* liboffloadmic/runtime/compiler_if_target.h: Ditto.
* liboffloadmic/runtime/dv_util.cpp: Ditto.
* liboffloadmic/runtime/dv_util.h: Ditto.
* liboffloadmic/runtime/emulator/coi_common.h: Ditto.
* liboffloadmic/runtime/emulator/coi_device.cpp: Ditto.
* liboffloadmic/runtime/emulator/coi_device.h: Ditto.
* liboffloadmic/runtime/emulator/coi_host.cpp: Ditto.
* liboffloadmic/runtime/emulator/coi_host.h: Ditto.
* liboffloadmic/runtime/emulator/coi_version_asm.h: Ditto.
* liboffloadmic/runtime/emulator/coi_version_linker_script.map: Ditto.
* liboffloadmic/runtime/emulator/myo_client.cpp: Ditto.
* liboffloadmic/runtime/emulator/myo_service.cpp: Ditto.
* liboffloadmic/runtime/emulator/myo_service.h: Ditto.
* liboffloadmic/runtime/emulator/myo_version_asm.h: Ditto.
* liboffloadmic/runtime/emulator/myo_version_linker_script.map: Ditto.
* liboffloadmic/runtime/liboffload_error.c: Ditto.
* liboffloadmic/runtime/liboffload_error_codes.h: Ditto.
* liboffloadmic/runtime/liboffload_msg.c: Ditto.
* liboffloadmic/runtime/liboffload_msg.h: Ditto.
* liboffloadmic/runtime/mic_lib.f90: Ditto.
* liboffloadmic/runtime/offload.h: Ditto.
* liboffloadmic/runtime/offload_common.cpp: Ditto.
* liboffloadmic/runtime/offload_common.h: Ditto.
* liboffloadmic/runtime/offload_engine.cpp: Ditto.
* liboffloadmic/runtime/offload_engine.h: Ditto.
* liboffloadmic/runtime/offload_env.cpp: Ditto.
* liboffloadmic/runtime/offload_env.h: Ditto.
* liboffloadmic/runtime/offload_host.cpp: Ditto.
* liboffloadmic/runtime/offload_host.h: Ditto.
* liboffloadmic/runtime/offload_myo_host.cpp: Ditto.
* liboffloadmic/runtime/offload_myo_host.h: Ditto.
* liboffloadmic/runtime/offload_myo_target.cpp: Ditto.
* liboffloadmic/runtime/offload_myo_target.h: Ditto.
* liboffloadmic/runtime/offload_omp_host.cpp: Ditto.
* liboffloadmic/runtime/offload_omp_target.cpp: Ditto.
* liboffloadmic/runtime/offload_orsl.cpp: Ditto.
* liboffloadmic/runtime/offload_orsl.h: Ditto.
* liboffloadmic/runtime/offload_table.cpp: Ditto.
* liboffloadmic/runtime/offload_table.h: Ditto.
* liboffloadmic/runtime/offload_target.cpp: Ditto.
* liboffloadmic/runtime/offload_target.h: Ditto.
* liboffloadmic/runtime/offload_target_main.cpp: Ditto.
* liboffloadmic/runtime/offload_timer.h: Ditto.
* liboffloadmic/runtime/offload_timer_host.cpp: Ditto.
* liboffloadmic/runtime/offload_timer_target.cpp: Ditto.
* liboffloadmic/runtime/offload_trace.cpp: Ditto.
* liboffloadmic/runtime/offload_trace.h: Ditto.
* liboffloadmic/runtime/offload_util.cpp: Ditto.
* liboffloadmic/runtime/offload_util.h: Ditto.
* liboffloadmic/runtime/ofldbegin.cpp: Ditto.
* liboffloadmic/runtime/ofldend.cpp: Ditto.
* liboffloadmic/runtime/orsl-lite/include/orsl-lite.h: Ditto.
* liboffloadmic/runtime/orsl-lite/lib/orsl-lite.c: Ditto.
* liboffloadmic/runtime/orsl-lite/version.txt: Ditto.
* boffloadmic/runtime/rdtsc.h: Ditto.
* liboffloadmic/runtime/use_mpss2.txt: Ditto.
* liboffloadmic/runtime/use_mpss_win.txt: Ditto.
--
Thanks, K
[-- Attachment #2: liboffload.patch.tar.bz2 --]
[-- Type: application/x-bzip2, Size: 242286 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATH] Intel offload library
2014-06-26 13:34 Kirill Yukhin
@ 2014-06-26 21:27 ` Joseph S. Myers
0 siblings, 0 replies; 11+ messages in thread
From: Joseph S. Myers @ 2014-06-26 21:27 UTC (permalink / raw)
To: Kirill Yukhin
Cc: Jakub Jelinek, Richard Henderson, bernds, Richard Biener,
Uros Bizjak, GCC Patches
Some observations on this code (the first is about integration in GCC, the
rest about general good practice for writing robust C libraries for use on
GNU/Linux, where failure to follow such practice is likely to lead to
problems and security advisories in future, so if the code goes in
without these being fixed then I think it would be desirable to have
clear plans for fixing them before 4.10 branches):
* Don't duplicate the logic for what's a hosted POSIX system; refactor it
to a common fragment in config/ (I guess it needs to be a shell script
fragment there rather than an actual autoconf macro, since you're using
that logic in configure.tgt which is itself such a fragment).
* There seems to be lots of code here that calls malloc or strdup (maybe
other allocation functions, but at least those two) then dereferences the
result without checking for errors. You need to check for errors and then
either return an error status or throw an exception (depending on what the
API of the function doing the allocation says is the way it should
indicate errors). (There could always be other functions being called
without error checking; for pretty much any standard C library function
that can return error status, you need to handle errors appropriately.)
* Code here is using getenv for various purposes. If it's to be safe to
use this functionality in setuid programs (and I see no obvious reason why
setuid programs shouldn't be able to use such offloading), then
secure_getenv should be used when available (glibc 2.17 and later), with
the relevant configuration being determined in some safe way when setuid
or those environment variables aren't set.
* Some code is using strtok. Is there a reason there can only ever be one
thread in the process when that code runs? If not, you shouldn't be using
strtok; strtok_r, as used elsewhere, is OK.
* Another thread issue: is there a reason there can only be one thread
when you call fopen? If not, with glibc you should specify "e" in the
fopen mode so that the file is opened with O_CLOEXEC, to avoid leaking
a file descriptor if another thread creates a process while the file is
open. Similarly, calls to open should use O_CLOEXEC when available,
unless you need file descriptors to stay open across exec.
* Generally it's not obvious to me whether the code using strcat, sprintf
etc. is safe against buffer overruns given arbitrary environment
variables, valid but extreme function arguments, etc. - I don't know what
the trust boundaries are in this code, but it would be a good idea to make
explicit, in code doing such buffer manipulations that are not obviously
safe, where the responsibility lies for safety (e.g. if the API for a
function is that arguments outside a certain range yield undefined
behavior, and it's clear that only outside that range can there be a
buffer overrun, make clear in any relevant documentation / comments that
this is the API, and ensure that callers coming with GCC respect that
API).
* MESSAGE_TABLE_NAME contains a string using 0x91 and 0x92 Windows-1252
quotes. It's wrong to use those unconditionally. If you want to use
non-ASCII messages you need to respect the user's locale (and if you do,
supporting translated messages via gettext is a good idea, not just making
quotes follow LC_CTYPE).
* I suspect your uses of PATH_MAX will cause trouble to anyone trying to
build this code for Hurd, though I think that can be left to Hurd porters
to fix. (More significant is that before blindly putting things in a
buffer of size PATH_MAX you need a reason that buffer can't overrun - it's
one thing if you know the path in question has already been successfully
opened, another if you're building it up by pieces without an API saying
the caller must ensure those pieces add up to no more than PATH_MAX in
size, and appropriate code in the callers to ensure this.)
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-09-10 6:28 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02 11:13 [PATH] Intel offload library Andrey Turetskiy
2014-07-21 9:46 ` Andrey Turetskiy
2014-07-28 7:33 ` Andrey Turetskiy
2014-07-30 21:26 ` Joseph S. Myers
2014-08-12 6:59 ` Andrey Turetskiy
2014-08-19 8:45 ` Kirill Yukhin
2014-08-26 6:42 ` Andrey Turetskiy
2014-09-04 7:41 ` Andrey Turetskiy
2014-09-10 6:28 ` Andrey Turetskiy
-- strict thread matches above, loose matches on Subject: below --
2014-06-26 13:34 Kirill Yukhin
2014-06-26 21:27 ` Joseph S. Myers
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).