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

Linux compiler fixes (GCC & CLANG) #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ckane
Copy link

@ckane ckane commented Nov 5, 2021

Modify the eBPF programlet compilation to add -fno-stack-protector similar to Sysinternals/SysmonForLinux#42

Additionally, the compiler warnings identified two calls to labs(...) that would always evaluate to true due to them operating on an unsigned value. I modified the less-than comparison to move the subtracted value from the left-hand side to be an added value to the right-hand side, and removed the labs(...) calls.

The eBPF programlets cannot be built with -fno-stack-protector, as they
won't be linked to the supporting code, as it doesn't make sense in
their context. Add -fno-stack-protector to the build_ebpf line so that
they won't be built with this feature when the feature is enabled for
the userland parts of the project.
The compiler complains that the value inside the labs(...) calls in both
places in this commit is an unsigned value, and always unsigned. Move
the value being subtracted to the right-hand-side as an addition, and
remove the labs(...) calls that would always return true.
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

1 participant