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

build: fix x86_64 asm detection for some compilers #373

Merged
merged 1 commit into from Feb 16, 2016

Conversation

theuni
Copy link
Contributor

@theuni theuni commented Jan 4, 2016

I'm not familiar enough with this asm syntax, there's probably a much simpler solution here, just switching to a test that doesn't need escaping.

I Noticed this on OSX with clang, though it likely happens elsewhere as well.
The result is disabled x86_64 asm.

Due to missing escaping, this $0 was interpreted as the function name
SECP_64BIT_ASM_CHECK, causing the compile-check to be broken on some compilers.

The actual check looked like this:

int main()
{
  uint64_t a = 11, tmp;
  __asm__ __volatile__("movq SECP_64BIT_ASM_CHECKx100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");
  return 0;
}

It seems even more odd that it compiled anywhere.

I Noticed this on OSX with clang, though it likely happens elsewhere as well.
The result is disabled x86_64 asm.

Due to missing escaping, this $0 was interpreted as the function name
SECP_64BIT_ASM_CHECK, causing the compile-check to be broken on some compilers.

The actual check looked like this:

int main()
{
  uint64_t a = 11, tmp;
  __asm__ __volatile__("movq SECP_64BIT_ASM_CHECKx100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");
  return 0;
}

It seems even more odd that it compiled anywhere.
@theuni
Copy link
Contributor Author

theuni commented Jan 7, 2016

I just double-checked this to see if i needed to push for urgent merge here for Bitcoin 0.12rc1.

For reference, this does not affect the clang version currently used for Bitcoin OSX release builds. So no rush.

@sipa sipa merged commit 3f8fdfb into bitcoin-core:master Feb 16, 2016
sipa added a commit that referenced this pull request Feb 16, 2016
3f8fdfb build: fix x86_64 asm detection for some compilers (Cory Fields)
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.

None yet

2 participants