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 for OpenBSD - See ticket #2397 #2405

Merged
merged 3 commits into from
Nov 13, 2024
Merged

Conversation

joseph-henry
Copy link
Contributor

No description provided.

laduke
laduke previously approved these changes Nov 12, 2024
glimberg
glimberg previously approved these changes Nov 12, 2024
@juanpeha
Copy link

Build still failing, but for a different cause:

clang++ -O3 -fstack-protector -Wall -fPIE -fvisibility=hidden -fstack-protector -pthread -isystem ext -Iext/prometheus-cpp-lite-1.0/core/include -Iext/prometheus-cpp-lite-1.0/simpleapi/include -DNDEBUG -DZT_USE_X64_ASM_SALSA2012 -DZT_BUILD_PLATFORM=9 -DZT_BUILD_ARCHITECTURE=2 -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\"" -std=c++17    -c -o osdep/BSDEthernetTap.o osdep/BSDEthernetTap.cpp
osdep/BSDEthernetTap.cpp:78:2: warning: field '_pinning' will be initialized after field '_arg' [-Wreorder-ctor]
        _pinning(pinning),
        ^~~~~~~~~~~~~~~~~
        _concurrency(concurrency)
osdep/BSDEthernetTap.cpp:338:2: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
        std::unique(r.begin(),r.end());
        ^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
osdep/BSDEthernetTap.cpp:393:2: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]
        std::unique(newGroups.begin(),newGroups.end());
        ^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
osdep/BSDEthernetTap.cpp:443:5: error: unknown type name 'cpu_set_t'
                                cpu_set_t cpuset;
                                ^
osdep/BSDEthernetTap.cpp:447:50: error: use of undeclared identifier 'cpu_set_t'; did you mean 'cpuset'?
                                int rc = pthread_setaffinity_np(self, sizeof(cpu_set_t), &cpuset);
                                                                             ^~~~~~~~~
                                                                             cpuset
osdep/BSDEthernetTap.cpp:443:15: note: 'cpuset' declared here
                                cpu_set_t cpuset;
                                          ^
3 warnings and 2 errors generated.
gmake: *** [<builtin>: osdep/BSDEthernetTap.o] Error 1

@joseph-henry joseph-henry dismissed stale reviews from glimberg and laduke via 969c0ee November 12, 2024 22:40
@joseph-henry
Copy link
Contributor Author

cpu_set_t

Thanks. I've omitted the CPU pinning code from OpenBSD builds for the time being. I'll look into what the equivalent of cpu_set_t is sometime and try to implement pinning again.

Let me know if this fixes things for you.

laduke
laduke previously approved these changes Nov 12, 2024
@juanpeha
Copy link

guess we're getting close, but not quite there yet:

clang++ -O3 -fstack-protector -Wall -fPIE -fvisibility=hidden -fstack-protector -pthread -isystem ex
t -Iext/prometheus-cpp-lite-1.0/core/include -Iext/prometheus-cpp-lite-1.0/simpleapi/include -DNDEBU
G -DZT_USE_X64_ASM_SALSA2012 -DZT_BUILD_PLATFORM=9 -DZT_BUILD_ARCHITECTURE=2 -DZT_SOFTWARE_UPDATE_DE
FAULT="\"disable\"" -std=c++17    -c -o osdep/BSDEthernetTap.o osdep/BSDEthernetTap.cpp
osdep/BSDEthernetTap.cpp:78:2: warning: field '_pinning' will be initialized after field '_arg' [-Wr
eorder-ctor]
        _pinning(pinning),
        ^~~~~~~~~~~~~~~~~
        _concurrency(concurrency)
osdep/BSDEthernetTap.cpp:338:2: warning: ignoring return value of function declared with 'nodiscard'
 attribute [-Wunused-result]
        std::unique(r.begin(),r.end());
        ^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
osdep/BSDEthernetTap.cpp:393:2: warning: ignoring return value of function declared with 'nodiscard'
 attribute [-Wunused-result]
        std::unique(newGroups.begin(),newGroups.end());
        ^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
osdep/BSDEthernetTap.cpp:502:4: error: expected unqualified-id
                }));
                 ^
osdep/BSDEthernetTap.cpp:504:1: error: extraneous closing brace ('}')
}
^
osdep/BSDEthernetTap.cpp:506:1: error: extraneous closing brace ('}')
} // namespace ZeroTier
^
In file included from osdep/BSDEthernetTap.cpp:55:
osdep/BSDEthernetTap.hpp:68:15: warning: private field '_concurrency' is not used [-Wunused-private-
field]
        unsigned int _concurrency;
                     ^
osdep/BSDEthernetTap.hpp:69:7: warning: private field '_pinning' is not used [-Wunused-private-field]
        bool _pinning;
             ^
5 warnings and 3 errors generated.
gmake: *** [<builtin>: osdep/BSDEthernetTap.o] Error 1

@joseph-henry
Copy link
Contributor Author

Sorry, I just don't have an OpenBSD system up right now to test compiles on. But I think this should fix it.

@juanpeha
Copy link

Bingo! Compiles now. Thank you very much.

@joseph-henry
Copy link
Contributor Author

No problem. Thanks for validating this for us! Have a great day.

@joseph-henry joseph-henry merged commit b12dd19 into dev Nov 13, 2024
4 checks passed
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