#72055 closed defect (fixed)

openssl3 @3.4.1: build fails on older OS versions: redefinition of 'fallback_atomic_exchange_n_uint64_t'

Reported by: aeiouaeiouaeiouaeiouaeiouaeiou Owned by: aeiouaeiouaeiouaeiouaeiouaeiou
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: neverpanic (Clemens Lang), RobK88
Port: openssl3

Description

/opt/local/libexec/clang-11-bootstrap/bin/clang  -I. -Iinclude -Iproviders/common/include -Iproviders/implementations/include  -DAES_ASM -DCMLL_ASM -DDES_ASM -DECP_NISTZ256_ASM -DGHASH_ASM -DMD5_ASM -DOPENSSL_BN_ASM_GF2m -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DPOLY1305_ASM -DRC4_ASM -DRMD160_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -fPIC -arch i386 -pipe -Os -arch i386 -DL_ENDIAN -DOPENSSL_PIC -DOPENSSLDIR="\"/opt/local/libexec/openssl3/etc/openssl\"" -DENGINESDIR="\"/opt/local/libexec/openssl3/lib/engines-3\"" -DMODULESDIR="\"/opt/local/libexec/openssl3/lib/ossl-modules\"" -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DZLIB -DNDEBUG -DBROKEN_CLANG_ATOMICS -I/opt/local/include -MMD -MF crypto/libcrypto-lib-threads_win.d.tmp -c -o crypto/libcrypto-lib-threads_win.o crypto/threads_win.c
crypto/threads_pthread.c:214:1: error: redefinition of 'fallback_atomic_exchange_n_uint64_t'
IMPL_fallback_atomic_exchange_n(uint64_t)
^
crypto/threads_pthread.c:186:26: note: expanded from macro 'IMPL_fallback_atomic_exchange_n'
    static ossl_inline t fallback_atomic_exchange_n_##t(t *p, t v)           \
                         ^

Suggested fix: https://github.com/openssl/openssl/pull/26690

Attachments (1)

26690.patch (19.0 KB) - added by aeiouaeiouaeiouaeiouaeiouaeiou 17 months ago.

Download all attachments as: .zip

Change History (16)

Changed 17 months ago by aeiouaeiouaeiouaeiouaeiouaeiou

Attachment: 26690.patch added

comment:1 Changed 17 months ago by rmottola (Riccardo)

I have the same issue on 10.5 i386

comment:2 Changed 17 months ago by rmottola (Riccardo)

I tried forcing a build with gcc... but clang-bootstrap is used anyway.

comment:3 Changed 17 months ago by neverpanic (Clemens Lang)

As you know, I don't support such old OS versions. My support policy is (current-3; current).

If you have a patch that works, please open a pull request.

comment:4 Changed 17 months ago by neverpanic (Clemens Lang)

Cc: neverpanic added

comment:5 Changed 17 months ago by rmottola (Riccardo)

No, I don't have a patch. Actually 10.5 works with x86-64bit, the problem here is 1386 apparently. Of course... 10.6 is the last to support 32 bit, so we can't know on newer systems.

comment:6 Changed 17 months ago by jmroot (Joshua Root)

Keywords: snowleopard removed
Summary: openssl3 @3.4.1: broken build on macOS 10.6 i386openssl3 @3.4.1: build fails on older OS versions: redefinition of 'fallback_atomic_exchange_n_uint64_t'

comment:7 in reply to:  5 Changed 17 months ago by jmroot (Joshua Root)

Replying to rmottola:

Actually 10.5 works with x86-64bit, the problem here is 1386 apparently. Of course... 10.6 is the last to support 32 bit, so we can't know on newer systems.

Building for i386 works up to 10.13. Duplicate #72066 indicates that a universal build also fails there.

comment:8 Changed 17 months ago by jmroot (Joshua Root)

If someone wants to make a PR, it should probably be based on these two commits with all the fixups from the upstream PR squashed:

comment:9 Changed 17 months ago by RobK88

Cc: RobK88 added

comment:10 Changed 17 months ago by aeiouaeiouaeiouaeiouaeiouaeiou

Deploying a VM with the exact architecture would burn my HDD, so please someone test this PR: https://github.com/macports/macports-ports/pull/27655

comment:11 Changed 17 months ago by neverpanic (Clemens Lang)

If somebody can confirm this is working, I'll merge it.

comment:12 Changed 17 months ago by rmottola (Riccardo)

today I am upgrading 10.11 and - without further patches - it fails. Same error with clang11:

crypto/threads_pthread.c:214:1: error: redefinition of 'fallback_atomic_exchange_n_uint64_t'
IMPL_fallback_atomic_exchange_n(uint64_t)
^
crypto/threads_pthread.c:186:26: note: expanded from macro 'IMPL_fallback_atomic_exchange_n'
    static ossl_inline t fallback_atomic_exchange_n_##t(t *p, t v)    

I do wonder, it is 64bit and it did upgrade on 10.5 64bit and 10.7 64bit! So I am a bit puzzled, wonder if it depends on some "context" of compiler, legacy-support or something else? @jmroot

comment:13 in reply to:  12 Changed 17 months ago by neverpanic (Clemens Lang)

Replying to rmottola:

today I am upgrading 10.11 and - without further patches - it fails. Same error with clang11:

Is this with the PR https://github.com/macports/macports-ports/pull/27655 or without? We'd love to see somebody test this PR, so if this fails for you, could you give this a shot?

comment:14 Changed 17 months ago by rmottola (Riccardo)

@neverpanic I specified "without further patches", so it was out of the box. Just noticed a newer version of MacOS 10.11 By applying the PR it compiled (don't know ho actually test it)

The reason why it works on 10.7 is quicky explained: it uses binary packages. So on the build server it did compile?

comment:15 Changed 17 months ago by aeiouaeiouaeiouaeiouaeiouaeiou

Owner: set to aeiouaeiouaeiouaeiouaeiouaeiou
Resolution: fixed
Status: newclosed

In 32dfc23aa9a830a0daec19e617cdb8464adeadcd/macports-ports (master):

openssl3: fix build on macOS =<10.6 i386/PowerPC

Closes: #72055

Note: See TracTickets for help on using tickets.