foniod / redbpf

Rust library for building and running BPF/eBPF modules
Apache License 2.0
1.71k stars 136 forks source link

fpic flag #257

Closed sebastiaoamaro closed 2 years ago

sebastiaoamaro commented 2 years ago

Added fpic flag to the build of "bpf-sys", related to issue #189.

rhdxmr commented 2 years ago

@sebastiaoamaro

Thank you for your contribution.

Please commit your code with Signed-off-by trailer. You can do that by git commit -s. And then re-push your branch with force option.

And it's vague to me what happens if both -fPIE and -fPIC are specified. So I think specifying only -fPIC is enough.

By compiling with -fPIC, the resulting relocatable file can be linked into PIE executables and shared libraries.

How do you think about replacing -fPIE with -fPIC? Not just appending -fPIC.

sebastiaoamaro commented 2 years ago

I am not an expert in the matter, but after reading the description it makes sense to me to replace -fPIE with -fPIC. I committed the change to this branch https://github.com/sebastiaoamaro/redbpf/tree/fpic-flag

rhdxmr commented 2 years ago

@sebastiaoamaro Could you do this in your main branch?

  1. git reset HEAD^. To reset right before the first commit
  2. Just remove -fPIE
  3. git commit -s. To commit with signature.
  4. git push -f. To push main branch forcibly.

I will be able to merge this PR after you do this tasks.

sebastiaoamaro commented 2 years ago

Never did a pull request before, Thanks for the patience :) Think it is done now? I hope...

rhdxmr commented 2 years ago

Yeah, this is what I expected. I'm approving this and build-test will start. I hope all build tests succeed.