Building sys-libs/libomp-3.7.0 for ABI=x32 fail with the following error: [24/36] /usr/bin/x86_64-pc-linux-gnux32-gcc -Domp_EXPORTS -Iruntime/src -I/var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src -I/var/tmp/ portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/i18n -I/var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/include/41 -I/v ar/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/thirdparty/ittnotify -DNDEBUG -march=native -O2 -pipe -fomit-frame-pointer -fPIC -D USE_ITT_BUILD -D KMP_ARCH_STR="\"Intel(R) 64\"" -D BUILD_I8 -D KMP_LIBRARY_FILE=\"libomp.so\" -D KMP_VERSION_MAJOR=5 -D KMP_NESTED_HOT_TEAMS -D CACHE_LINE=64 - D KMP_ADJUST_BLOCKTIME=1 -D BUILD_PARALLEL_ORDERED -D KMP_ASM_INTRINS -D USE_ITT_NOTIFY=1 -D INTEL_ITTNOTIFY_PREFIX=__kmp_itt_ -D KMP_USE_VERSION_SYMBOLS -D _G NU_SOURCE -D _REENTRANT -D BUILD_TV -D USE_CBLKDATA -D KMP_GOMP_COMPAT -D USE_LOAD_BALANCE -D KMP_TDATA_GTID -D KMP_USE_ASSERT -D KMP_DYNAMIC_LIB -D KMP_STATS_ ENABLED=0 -D USE_DEBUGGER=0 -D OMPT_SUPPORT=0 -D OMPT_BLAME=1 -D OMPT_TRACE=1 -D OMP_50_ENABLED=0 -D OMP_41_ENABLED=1 -D OMP_40_ENABLED=1 -D OMP_30_ENABLED=1 - D KMP_USE_ADAPTIVE_LOCKS=1 -D KMP_DEBUG_ADAPTIVE_LOCKS=0 -D KMP_USE_INTERNODE_ALIGNMENT=0 -DNDEBUG -std=c++11 -fno-exceptions -Wno-sign-compare -Wno-unused-fu nction -Wno-unused-value -Wno-unused-variable -Wno-switch -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-missing-braces -Wno-comment -x c++ -MMD -MT runtime/src/CMakeFiles/omp.dir/kmp_ftn_cdecl.c.o -MF runtime/src/CMakeFiles/omp.dir/kmp_ftn_cdecl.c.o.d -o runtime/src/CMakeFiles/omp.dir/kmp_ftn_cdecl.c.o -c /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/kmp_ftn_cdecl.c FAILED: /usr/bin/x86_64-pc-linux-gnux32-gcc -Domp_EXPORTS -Iruntime/src -I/var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src -I/var/tmp/ portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/i18n -I/var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/include/41 -I/v ar/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/thirdparty/ittnotify -DNDEBUG -march=native -O2 -pipe -fomit-frame-pointer -fPIC -D USE_ITT_BUILD -D KMP_ARCH_STR="\"Intel(R) 64\"" -D BUILD_I8 -D KMP_LIBRARY_FILE=\"libomp.so\" -D KMP_VERSION_MAJOR=5 -D KMP_NESTED_HOT_TEAMS -D CACHE_LINE=64 - D KMP_ADJUST_BLOCKTIME=1 -D BUILD_PARALLEL_ORDERED -D KMP_ASM_INTRINS -D USE_ITT_NOTIFY=1 -D INTEL_ITTNOTIFY_PREFIX=__kmp_itt_ -D KMP_USE_VERSION_SYMBOLS -D _G NU_SOURCE -D _REENTRANT -D BUILD_TV -D USE_CBLKDATA -D KMP_GOMP_COMPAT -D USE_LOAD_BALANCE -D KMP_TDATA_GTID -D KMP_USE_ASSERT -D KMP_DYNAMIC_LIB -D KMP_STATS_ ENABLED=0 -D USE_DEBUGGER=0 -D OMPT_SUPPORT=0 -D OMPT_BLAME=1 -D OMPT_TRACE=1 -D OMP_50_ENABLED=0 -D OMP_41_ENABLED=1 -D OMP_40_ENABLED=1 -D OMP_30_ENABLED=1 - D KMP_USE_ADAPTIVE_LOCKS=1 -D KMP_DEBUG_ADAPTIVE_LOCKS=0 -D KMP_USE_INTERNODE_ALIGNMENT=0 -DNDEBUG -std=c++11 -fno-exceptions -Wno-sign-compare -Wno-unused-fu nction -Wno-unused-value -Wno-unused-variable -Wno-switch -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-missing-braces -Wno-comment -x c++ -MMD -MT runtime/src/CMakeFiles/omp.dir/z_Linux_util.c.o -MF runtime/src/CMakeFiles/omp.dir/z_Linux_util.c.o.d -o runtime/src/CMakeFiles/omp.dir/z_Linux_util.c.o -c /v ar/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/z_Linux_util.c /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/z_Linux_util.c:154:6: error: #error Wrong code for setaffinity system call. # error Wrong code for setaffinity system call. ^ /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/z_Linux_util.c:159:6: error: #error Wrong code for getaffinity system call. # error Wrong code for getaffinity system call. ^ In file included from /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/kmp_itt.h:23:0, from /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/z_Linux_util.c:18: /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/thirdparty/ittnotify/ittnotify.h:1761:28: warning: always_inline function might not be inlinable [-Wattributes] ITT_INLINE __itt_id ITTAPI __itt_id_make(void* addr, unsigned long long extra) ^ In file included from /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/thirdparty/ittnotify/ittnotify_static.c:27:0: /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/thirdparty/ittnotify/ittnotify.h:1761:28: warning: always_inline function might not be inlinable [-Wattributes] ITT_INLINE __itt_id ITTAPI __itt_id_make(void* addr, unsigned long long extra) ^ In file included from /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/thirdparty/ittnotify/ittnotify_static.c:11:0: /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/thirdparty/ittnotify/ittnotify_config.h:301:17: warning: always_inline function might not be inlinable [-Wattributes] ITT_INLINE long __itt_interlocked_increment(volatile long* ptr) ^ /var/tmp/portage/sys-libs/libomp-3.7.0/work/openmp-3.7.0.src/runtime/src/thirdparty/ittnotify/ittnotify_config.h:286:17: warning: always_inline function might not be inlinable [-Wattributes] ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend) ^ ninja: build stopped: subcommand failed. * ERROR: sys-libs/libomp-3.7.0::gentoo failed (compile phase): * (no error message) * * Call stack: * ebuild.sh, line 133: Called src_compile * environment, line 3480: Called multilib-minimal_src_compile * environment, line 2588: Called multilib_foreach_abi 'multilib-minimal_abi_src_compile' * environment, line 2819: Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile' * environment, line 2523: Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_compile' * environment, line 2521: Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_compile' * environment, line 600: Called multilib-minimal_abi_src_compile * environment, line 2582: Called multilib_src_compile * environment, line 3031: Called cmake-utils_src_compile * environment, line 850: Called _execute_optionally 'src_compile' * environment, line 396: Called enable_cmake-utils_src_compile * environment, line 1055: Called cmake-utils_src_make * environment, line 865: Called ninja_src_make * environment, line 3095: Called die * The specific snippet of code: * "$@" || die Full build log attached as long as emerge --info Reproducible: Always
Created attachment 422258 [details] build.log
Created attachment 422260 [details] emerge --info
Thanks for the report! I suppose ABI=x32 will have to be dropped from 3.7.* packages, unless the fix is easy. Does 3.8.0 work?
/usr/include/asm/unistd_32.h:243:#define __NR_sched_setaffinity 241 /usr/include/asm/unistd_32.h:244:#define __NR_sched_getaffinity 242 /usr/include/asm/unistd_64.h:207:#define __NR_sched_setaffinity 203 /usr/include/asm/unistd_64.h:208:#define __NR_sched_getaffinity 204 /usr/include/asm/unistd.h:5:#define __X32_SYSCALL_BIT 0x40000000 /usr/include/asm/unistd_x32.h:185:#define __NR_sched_setaffinity (__X32_SYSCALL_BIT + 203) /usr/include/asm/unistd_x32.h:186:#define __NR_sched_getaffinity (__X32_SYSCALL_BIT + 204)
Still happening with current git. I'll have to look at it eventually, I want to give LLVM a proper x32 support.
Created attachment 464760 [details, diff] experimental x32 patch I've had a go at porting this one. It compiles/emerges fine, not yet tested further. I'm trying to bring up a x32 system again...
Created attachment 517226 [details, diff] patch for sys-libs/libomp-5.0.1 for building on x32 The patch from last year for sys-libs/libomp-3.7.0 does not work because the code changed very much. With this patch i was able to build and install sys-libs/libomp-5.0.1 .
Thanks for the patch. Does the test suite pass with it? Was it submitted upstream by any chance?
To answer your questions: no and no. will look deeper into it...
Thanks a lot. In any case, if it's an improvement over the previous state (even if not reproduced in tests), it's worth submitting upstream. Please let me know if you need me to do that for you.
Created attachment 517358 [details, diff] patch for sys-libs/libomp-5.0.1 for building on x32 (version 2) I revisited my patch and added two more mods to silence one compiler warning and correct one test failing. On pure 64bit build one other test fails anyway so i did not edit out the very same failure on x32. Could you give me a pointer how to send this to upstream? p.s. one small assembly patch for x32 is in the gentoo build already, should this go to upstream too?
please disregard the "p.s." from before, this was from another package ;)
For a start, you'd need to rebase it against master/trunk. I think you shouldn't have problems building/testing it against LLVM 5.0.1 though. If you need me to test it with -9999, just let me know and I'll try it (I have x32-enabled compiler here). This is the main doc on submitting patches: https://llvm.org/docs/DeveloperPolicy.html This one's if you're going to use Phabricator (I'd recommend that): https://llvm.org/docs/Phabricator.html Please add me (mgorny) as subscriber for any patches you submit. You can either ask whoever reviews them to commit them for you, or I can do that.
I did as instructed. Looks like libomp-7 is to be released soon, hope this fix gets into it before.
If you asked for docs, you should've read them ;-P. Make a patch with -U9999, and add openmp-commits as subscriber, and some reviewers from git/svn blame.
I've read your advice. Did dump the patch to upstream first, the rest will follow.
Created attachment 517494 [details, diff] patch for sys-libs/libomp-6.0.9999 for building on x32 (version 3) I realized the former patches did not cut it. Now, X32 is implemented as distinct arch instead of a dirty hack to just make it compile.
Created attachment 517502 [details, diff] patch to sys-libs/libomp-6.0.9999 for building on x32 (version 3b) bug-bugfix.
Bug persists to day in all versions I tried: 6.0.1-r1, 7.1.0, 8.0.0. I could only build it by commenting the malfunction '#ifndef' lines 193 //#ifndef __NR_sched_setaffinity 194 #define __NR_sched_setaffinity 203 //... 198 //#ifndef __NR_sched_getaffinity 199 #define __NR_sched_getaffinity 204 //... within '/var/tmp/portage/sys-libs/libomp-8.0.0/work/openmp-8.0.0.src/runtime/src/kmp_affinity.h'
Created attachment 794255 [details, diff] An updated patch for libomp-14.0.4 Here is an updated patch for libomp-14.0.4 which based on previous patch.
(In reply to Kenny Cheng from comment #20) > Created attachment 794255 [details, diff] [details, diff] > An updated patch for libomp-14.0.4 > > Here is an updated patch for libomp-14.0.4 which based on previous patch. Could you send the patch upstream? https://reviews.llvm.org/