Date: Mon, 29 Dec 2025 16:28:06 -0300
On Monday, 29 December 2025 11:53:08 Brasilia Standard Time Andrey Semashev
via Std-Proposals wrote:
> Why do you need a separate main2() if you can already do all of this in
> the standard main()?
On Linux, you don't even need that. Just set your linker arch to x86-64-v2
(SSE4.2) and glibc will refuse to run your application if it doesn't match.
>From elf.h:
/* GNU_PROPERTY_X86_ISA_1_V2: GNU_PROPERTY_X86_ISA_1_BASELINE,
CMPXCHG16B (cmpxchg16b), LAHF-SAHF (lahf), POPCNT (popcnt), SSE3,
SSSE3, SSE4.1 and SSE4.2. */
#define GNU_PROPERTY_X86_ISA_1_V2 (1U << 1)
There are now several Linux distributions that require v2. For example,
openSUSE 16.0 and Slowroll, Red Hat Enterprise Linux 9. I've seen some
discussion that RHEL10 should even be v3.
via Std-Proposals wrote:
> Why do you need a separate main2() if you can already do all of this in
> the standard main()?
On Linux, you don't even need that. Just set your linker arch to x86-64-v2
(SSE4.2) and glibc will refuse to run your application if it doesn't match.
>From elf.h:
/* GNU_PROPERTY_X86_ISA_1_V2: GNU_PROPERTY_X86_ISA_1_BASELINE,
CMPXCHG16B (cmpxchg16b), LAHF-SAHF (lahf), POPCNT (popcnt), SSE3,
SSSE3, SSE4.1 and SSE4.2. */
#define GNU_PROPERTY_X86_ISA_1_V2 (1U << 1)
There are now several Linux distributions that require v2. For example,
openSUSE 16.0 and Slowroll, Red Hat Enterprise Linux 9. I've seen some
discussion that RHEL10 should even be v3.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel Data Center - Platform & Sys. Eng.
Received on 2025-12-29 19:28:09
