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

Adapt Makefile for RPM packaging #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mikhailnov
Copy link

When building an RPM via rpmbuild, we need to:

  • pass system default compiler flags, example from ROSA 2023.1:
$ rpm -E %optflags
-O2 -fomit-frame-pointer -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -fstack-protector-strong --param=ssp-buffer-size=4 -m64 -mtune=generic
  • pass system default linker flags
  • pass directory where files should be copied to (DESTDIR)
  • build an unstripped binary, RPM will strip it by itself and save debuginfo in a special way

All these changes will be usefull for any other packaging format, not only RPM.

When building an RPM via rpmbuild, we need to:
* pass system default compiler flags, example from ROSA 2023.1:
$ rpm -E %optflags
-O2 -fomit-frame-pointer -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -fstack-protector-strong --param=ssp-buffer-size=4 -m64 -mtune=generic
* pass system default linker flags
* pass directory where files should be copied to (DESTDIR)
* build an unstripped binary, RPM will strip it by itself and save debuginfo in a special way

All these changes will be usefull for any other packaging format, not only RPM.
@mikhailnov
Copy link
Author

BSD systems may benefit from automaticaly set correct compiler

@ondrej-zary
Copy link
Owner

This would disable optimization and stripping for the manual build/install.

@mikhailnov
Copy link
Author

Agree, -O2 should be left by default. What about stripping, is it really needed?

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

2 participants