-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: Use -fcf-protection for GCC >= 8 or Clang >= 7 #944
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine @Krechals, thank you, see the one comment.
About the build still failing with clang 7
, should we add a global check for the clang
version and fail if it's <= 9 (it could be only for x86_64
or whatever setup fails to build)?
Something like this.
--- LATER EDIT: This will be done by #949
I would also split the PR into 2 commits, one that adds the -fcf-protection
flag and one that adds the error_if_clang_version_lt
rule to the build system.
@Krechals, could you please take a look in this PR to have it ready for upstream? See @StefanJum's comments. @mariasfiraiala , please also take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works fine, thanks! @Krechals can you please address @StefanJum's comments in order to have this merged? I think they make sense.
c379f9b
to
5496ff3
Compare
5496ff3
to
bdd29af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thanks!
Reviewed-by: Maria Sfiraiala maria.sfiraiala@gmail.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit adds a minimum compiler version check, which is 9.0
for clang
. So we only need the check for gcc
.
Something like
ifeq ($(call have_gcc),y)
COMPFLAGS-$(call gcc_version_ge,8,0) += -fcf-protection=none
else
COMPFLAGS-y += -fcf-protection=none
endif
or
COMPFLAGS-$(call gcc_version_ge,8,0) += -fcf-protection=none
COMPFLAGS-$(call have_clang) += -fcf-protection=none
could be better?
bdd29af
to
2c0dfd0
Compare
All good now @Krechals, just please remove the id |
Signed-off-by: Andrei Tudor TOPALĂ <topala.andrei@gmail.com>
2c0dfd0
to
2906df3
Compare
✅ Checkpatch passed Beep boop! I ran Unikraft's
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thanks.
Reviewed-by: Stefan Jumarea stefanjumarea02@gmail.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved-by: Razvan Deaconescu razvand@unikraft.io
Prerequisite checklist
checkpatch.uk
on your commit series before opening this PR;Base target
x86_64
or N/A]kvm
,xen
or N/A]app-python3
or N/A]Additional configuration
Description of changes
The build fails on every app when gcc-8.0+ isn't used.
-fcf-protection was introduced in gcc-8.0 and in clang-7.0.
The build still fails for clang-7.0, since
__asm__ goto
fromplat/kvm/x86/traps.c
was introduced in clang-9.0.GitHub-Depends-On: #983