Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#69330 closed defect (invalid)

onetbb uses illegal instruction on i386: no such instruction: `tpause %ecx' that is not supported when macports is forced to use a non-default gcc compiler and an old assembler to try to build it as a fun experiment

Reported by: barracuda156 Owned by: mohd-akram (Mohamed Akram)
Priority: Normal Milestone:
Component: ports Version: 2.9.1
Keywords: i386 Cc:
Port: onetbb

Description

[ 15%] Building CXX object src/tbbmalloc/CMakeFiles/tbbmalloc.dir/large_objects.cpp.o
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_onetbb/onetbb/work/build/src/tbbmalloc && /opt/local/bin/g++-mp-13 -D__TBBMALLOC_BUILD -D__TBB_USE_ITT_NOTIFY -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_onetbb/onetbb/work/oneTBB-2021.11.0/src/tbbmalloc/../../include -pipe -Os -DNDEBUG -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -mmacosx-version-min=10.6 -fPIC -flifetime-dse=1 -Wall -Wextra -Werror -Wfatal-errors -fno-rtti -fno-exceptions -D_XOPEN_SOURCE -mrtm -mwaitpkg -fstack-clash-protection -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -D_FORTIFY_SOURCE=2 -MD -MT src/tbbmalloc/CMakeFiles/tbbmalloc.dir/large_objects.cpp.o -MF CMakeFiles/tbbmalloc.dir/large_objects.cpp.o.d -o CMakeFiles/tbbmalloc.dir/large_objects.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_onetbb/onetbb/work/oneTBB-2021.11.0/src/tbbmalloc/large_objects.cpp
:211:no such instruction: `tpause %ecx'
make[2]: *** [src/tbb/CMakeFiles/tbb.dir/arena.cpp.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_onetbb/onetbb/work/build'
make[1]: *** [src/tbb/CMakeFiles/tbb.dir/all] Error 2
  1. S. Pointless to report to upstream, they do not support 32-bit systems.

Change History (6)

comment:1 Changed 3 months ago by reneeotten (Renee Otten)

well if upstream doesn’t support it what do you want the port maintainer to do here. These type of tickets seem very useless… if it’s something you are interested in, feel free to fix it and submit a PR - no point in opening tickets IMHO.

comment:2 Changed 3 months ago by kencu (Ken)

using gcc to build things usually forces the ancient Apple gas assembler which is very outdated.

any current clang should work

https://github.com/oneapi-src/oneTBB/blob/7340a880885cfec2bf05d981e83e44612d1efb6e/include/oneapi/tbb/detail/_config.h#L338

or you can use the macports cctools mod that uses a newer clang as assembler,

or you can alter the test to disable the tpause functions in tbb instead:

https://github.com/oneapi-src/oneTBB/blob/7340a880885cfec2bf05d981e83e44612d1efb6e/include/oneapi/tbb/detail/_config.h#L338

comment:3 Changed 3 months ago by kencu (Ken)

Looking at the portfile, I cannot see how this should be building with gcc13 on 10.6 i386 anyway.

comment:4 Changed 3 months ago by kencu (Ken)

Resolution: invalid
Status: assignedclosed
Summary: onetbb uses illegal instruction on i386: no such instruction: `tpause %ecx'onetbb uses illegal instruction on i386: no such instruction: `tpause %ecx' that is not supported when macports is forced to use a non-default gcc compiler and an old assembler to try to build it as a fun experiment

builds fine on the buildbot with clang-11

comment:5 in reply to:  2 Changed 3 months ago by barracuda156

Replying to kencu:

or you can alter the test to disable the tpause functions in tbb instead:

https://github.com/oneapi-src/oneTBB/blob/7340a880885cfec2bf05d981e83e44612d1efb6e/include/oneapi/tbb/detail/_config.h#L338

Thank you, your suggestion worked to resolve the issue.

  1. S. Will any Macports clang assembler work with libstdc++ (for Intel, obviously)?

(On a side note, this is potentially a problematic solution, since some ports will build without errors but produce broken binaries: having assembler recognizing AVX, for example, will not make CoreDuo to support them. GCC at least honestly fails at compile time.)

comment:6 in reply to:  3 Changed 3 months ago by barracuda156

Replying to kencu:

Looking at the portfile, I cannot see how this should be building with gcc13 on 10.6 i386 anyway.

BTW, judging from this, it will not build with Clang on certain Intel cpus either: https://stackoverflow.com/questions/22395292/assembler-messages-no-such-instruction-xbegin Since TSX is not necessarily supported on hardware level: https://en.wikipedia.org/wiki/Transactional_Synchronization_Extensions

After disabling __TBB_TSX_INTRINSICS_PRESENT I have OneTBB built.

sergey-fedorovs-mac-mini:~ svacchanda$ port -v installed onetbb
The following ports are currently installed:
  onetbb @2021.11.0_1 (active) requested_variants='' platform='darwin 10' archs='i386' date='2024-02-14T02:36:47+0800'
Note: See TracTickets for help on using tickets.