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

Update spec for compiler flags and systemd user #4961

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

fmarco76
Copy link
Member

C and C++ flags are now retrieved from 'optflags' macro. In Fedora this is:

CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '

Additionally, user creation is moved to systemd.

@fmarco76 fmarco76 requested a review from edewata February 13, 2025 13:49
Copy link
Contributor

@edewata edewata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The optflags changes look good (feel free to merge it first), but I was informed that sysusers.d so far is only available on Fedora, so it might break CentOS 10 build (CentOS 9 build is already broken for a different reason) and probably RHEL too:
https://copr.fedorainfracloud.org/coprs/g/pki/master/builds/

Could you add %ifdef for sysusers.d-related code in Fedora and keep the original code for other platforms?

pki.spec Outdated
Comment on lines 1206 to 1207
cat >dogtag-pki.sysusers.conf <<EOF
g pkiuser %{pki_gid}
u pkiuser %{pki_uid} 'Certificate System' %{pki_homedir} -
EOF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the file name need to match the package name (which could be different on different platforms)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested on fedora and I was not thinking to this problem. We can use the package name to avoid problem. However, the change should be in the new line 1517 where the file is moved to the final location.

C and C++ flags are now retrieved from 'optflags' macro. In Fedora this is:

    CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
Copy link
Contributor

@edewata edewata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the update!

@fmarco76
Copy link
Member Author

@edewata Thanks!

@fmarco76 fmarco76 merged commit 83d6a75 into dogtagpki:master Feb 13, 2025
170 of 177 checks passed
@fmarco76 fmarco76 deleted the updateSpeck branch February 13, 2025 19:34
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