From noloader at gmail.com Fri Nov 9 23:52:02 2018 From: noloader at gmail.com (Jeffrey Walton) Date: Fri, 9 Nov 2018 17:52:02 -0500 Subject: How to remove hwcaps_2 from a program Message-ID: Hi Everyone, Sorry for asking here. The Solaris x86 newsgroup looks inactive. My apologies in advance. I'm having trouble removing hwcaps_2 from an executable and shared object. It results in the following: $ ./cryptest.exe v ld.so.1: cryptest.exe: fatal: cryptest.exe: hardware capability (CA_SUNW_HW_2) unsupported: 0x40 [ AVX2 ] This particular machine lacks AVX2, but we guard the code path at runtime. My mapfile looks like so: $ cat cryptopp.mapfile hwcap_1 = SSE SSE2 OVERRIDE; hwcap_2 = V0x0; I can't add OVERRIDE to hwcaps_2: $ cat cryptopp.mapfile hwcap_1 = SSE SSE2 OVERRIDE; hwcap_2 = V0x0 OVERRIDE; It results in: ld: fatal: cryptopp.mapfile: 6: unknown segment attribute: override make: *** [GNUmakefile:1089: cryptest.exe] Error 2 I am also aware of https://www.oracle.com/technetwork/server-storage/solaris/hwcap-modification-139536.html , but none of the techniques work for me. How do I remove hwcaps_2 from the executable and shared library? We are trying to support back to Solaris 9 so $mapfile_version 1 is preferred. Thanks in advance. ++++++++++ Here is the output from link: $ CXX=/opt/developerstudio12.5/bin/CC make -j 5 /opt/developerstudio12.5/bin/CC -o cryptest.exe -DNDEBUG -g -xO3 -template=no%ex tdef adhoc.o test.o bench1.o bench2.o bench3.o datatest.o dlltest.o fipsalgt.o v alidat0.o validat1.o validat2.o validat3.o validat4.o validat5.o validat6.o vali dat7.o validat8.o validat9.o validat10.o regtest1.o regtest2.o regtest3.o regtes t4.o ./libcryptopp.a -xarch=sse2 -xarch=ssse3 -xarch=sse4_1 -xarch=sse4_2 -xarch =aes -xarch=avx -xarch=avx2 -M cryptopp.mapfile -lnsl -lsocket And: $ elfdump -H cryptest.exe Capabilities Section: .SUNW_cap Object Capabilities: index tag value [0] CA_SUNW_HW_2 0x40 [ AVX2 ] [1] CA_SUNW_HW_1 0x1800 [ SSE2 SSE ]