Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

mpsuzuki
Copy link
Contributor

@mpsuzuki mpsuzuki commented Nov 8, 2024

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

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

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

https://github.com/gcc-mirror/gcc/blob/releases/gcc-4.0/gcc/builtins.def
https://github.com/gcc-mirror/gcc/blob/releases/gcc-4.1.0/gcc/builtins.def

It would be safer to deal gcc-4.0 as gcc-3.x or older one.
@wolfSSL-Bot
Copy link

Can one of the admins verify this patch?

@dgarske
Copy link
Contributor

dgarske commented Nov 8, 2024

Okay to test. Contributor agreement on file.

@mpsuzuki
Copy link
Contributor Author

mpsuzuki commented Nov 9, 2024

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
Copy link
Contributor

douzzer commented Nov 9, 2024

retest this please.

@douzzer
Copy link
Contributor

douzzer commented Nov 12, 2024

retest this please

@dgarske dgarske requested a review from douzzer November 15, 2024 01:58
@dgarske
Copy link
Contributor

dgarske commented Nov 15, 2024

Retest this please. History lost for failed PRB test.

@dgarske
Copy link
Contributor

dgarske commented Nov 15, 2024

@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.

@dgarske dgarske assigned mpsuzuki and unassigned douzzer Nov 15, 2024
@douzzer douzzer mentioned this pull request Nov 17, 2024
@douzzer
Copy link
Contributor

douzzer commented Nov 17, 2024

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

@douzzer douzzer closed this Nov 17, 2024
@mpsuzuki
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants