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

Workaround build failure with glibc >= 2.34 #4843

Closed
wants to merge 1 commit into from

Conversation

schnitzeltony
Copy link

Seems glibc changed definition of MINSIGSTKSZ to

| # define MINSIGSTKSZ SIGSTKSZ
and
| # define SIGSTKSZ sysconf (_SC_SIGSTKSZ)

which is not constexpr. So build fails with:
| In file included from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/recipe-sysroot/usr/include/signal.h:328,
| from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/libs/catch2/include/catch2/catch2.hpp:7641,
| from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/src/headless/UnitTests.cpp:3:
| /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/libs/catch2/include/catch2/catch2.hpp:10455:58: error: call to non-'constexpr' function 'long int sysconf(int)'
| 10455 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
| | ^~~~~~~~~~~
| In file included from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/recipe-sysroot/usr/include/bits/sigstksz.h:24,
| from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/recipe-sysroot/usr/include/signal.h:328,
| from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/libs/catch2/include/catch2/catch2.hpp:7641,
| from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/src/headless/UnitTests.cpp:3:
| /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/recipe-sysroot/usr/include/unistd.h:641:17: note: 'long int sysconf(int)' declared here
| 641 | extern long int sysconf (int __name) __THROW;
| | ^~~~~~~
| In file included from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/src/headless/UnitTests.cpp:3:
| /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/libs/catch2/include/catch2/catch2.hpp:10514:45: error: size of array 'altStackMem' is not an integral constant-expression
| 10514 | char FatalConditionHandler::altStackMem[sigStackSize] = {};
| | ^~~~~~~~~~~~

Signed-off-by: Andreas Müller [email protected]

Seems glibc changed definition of MINSIGSTKSZ to

| # define MINSIGSTKSZ SIGSTKSZ
and
| # define SIGSTKSZ sysconf (_SC_SIGSTKSZ)

which is not constexpr. So build fails with:
| In file included from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/recipe-sysroot/usr/include/signal.h:328,
|                  from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/libs/catch2/include/catch2/catch2.hpp:7641,
|                  from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/src/headless/UnitTests.cpp:3:
| /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/libs/catch2/include/catch2/catch2.hpp:10455:58: error: call to non-'constexpr' function 'long int sysconf(int)'
| 10455 |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
|       |                                                          ^~~~~~~~~~~
| In file included from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/recipe-sysroot/usr/include/bits/sigstksz.h:24,
|                  from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/recipe-sysroot/usr/include/signal.h:328,
|                  from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/libs/catch2/include/catch2/catch2.hpp:7641,
|                  from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/src/headless/UnitTests.cpp:3:
| /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/recipe-sysroot/usr/include/unistd.h:641:17: note: 'long int sysconf(int)' declared here
|   641 | extern long int sysconf (int __name) __THROW;
|       |                 ^~~~~~~
| In file included from /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/src/headless/UnitTests.cpp:3:
| /home/superandy/tmp/oe-core-glibc/work/cortexa72-mortsgna-linux/surge/1.9.0-r0/git/libs/catch2/include/catch2/catch2.hpp:10514:45: error: size of array 'altStackMem' is not an integral constant-expression
| 10514 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
|       |                                             ^~~~~~~~~~~~

Signed-off-by: Andreas Müller <[email protected]>
@baconpaul
Copy link
Collaborator

Thank you
Before we merge tbis I want to be sure that cafch2 hasn’t fixed it upstream since we have an amalgamated snapshot we haven’t updated in 18 months

@schnitzeltony
Copy link
Author

If upstream has fixed, upgrading is surely the better solution. Then consider this PR just as 'ping - glibc >= 2.34 requires fixes'

@baconpaul
Copy link
Collaborator

Yes I will either pull upstream or merge this and notify upstream :)

later tonight though. Will update pr once I get to look

thanks again

@baconpaul
Copy link
Collaborator

baconpaul commented Aug 16, 2021

paul:~/dev/music/surge-xt$ egrep 'v2|MINSIGSTKSZ' ~/Downloads/catch.hpp 
 *  Catch v2.13.7
paul:~/dev/music/surge-xt$ egrep 'v2|MINSIGSTKSZ' libs/catch2/include/catch2/catch2.hpp 
 *  Catch v2.9.2
    static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;

yup so let me put in a PR to push us to 2.13.7 and see if things work. If they do I'll close this one.

@baconpaul
Copy link
Collaborator

Resolved by upgrade in #4845
if you can confirm that works on your system would be appreciated, but the offending line is missing.
Thanks!

@baconpaul baconpaul closed this Aug 16, 2021
@schnitzeltony
Copy link
Author

Replaced my workaround by your catch2 update and can confirm it builds fine with glibc 2.34.
Thanks!

schnitzeltony added a commit to schnitzeltony/meta-musicians that referenced this pull request Aug 16, 2021
@baconpaul
Copy link
Collaborator

Awesome! Hope you enjoy using surge in your project. Let us know if you run into any other troubles.

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.

2 participants