wolfSSL / wolfssl

The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3!
https://www.wolfssl.com
GNU General Public License v2.0
2.36k stars 834 forks source link

gcc-4.0.x does not have __sync_synchronize() to be used for XFENCE #8163

Closed mpsuzuki closed 4 days ago

mpsuzuki commented 2 weeks ago

wc_port.h expects __sync_synchronize() in gcc-4.x, but it was introduced since gcc-4.1.0.

Please find the end of gcc/builtins.def in gcc-4.0 branch and gcc-4.1.0 (sorry, the changeset between gcc-4.0.4 and gcc-4.1.0 is too huge for github.com's comparison feature to display well).

gcc-4.0.x gcc/builtins.def image

gcc-4.1.0 gcc/builtins.def image

It would be safer to deal gcc-4.0 as gcc-3.x or older one.

Description

To build wolfSSL by ancient gcc on ancient platform, the C preprocessor-based function availability classification is improved.

Testing

Building wolfSSL with gcc-4.0.0 (on FreeBSD 5.5) finishes. Without this modification, the built libwolfssl.so would have an unresolvable reference to __sync_synchronize(), and it makes the linking of wolfcrypt/benchmark/benchmark failed as

src/.libs/libwolfssl.so: undefined reference to `__sync_synchronize'

Checklist

wolfSSL-Bot commented 2 weeks ago

Can one of the admins verify this patch?

dgarske commented 1 week ago

Okay to test. Contributor agreement on file.

mpsuzuki commented 1 week ago

Oh, what? During the check, a building test on latest macOS is reported as failed. I would try to reproduce the error in my environment...

douzzer commented 1 week ago

retest this please.

douzzer commented 1 week ago

retest this please

dgarske commented 6 days ago

Retest this please. History lost for failed PRB test.

dgarske commented 6 days ago

@mpsuzuki Can you please rebase to latest master? Getting a failure on [PRB-fips-repo-and-harness-test-v3-part2] but I cannot get the history. I think the PR change is okay.

douzzer commented 4 days ago

fixed by #8195 -- thank you @mpsuzuki for prompting the fix!

mpsuzuki commented 4 days ago

I apologize that I failed to rebase my patch timely, anyway, thank you for caring about the ancient gcc!