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

WIP: Build firejail with meson #4656

Closed
wants to merge 35 commits into from
Closed

Conversation

rusty-snake
Copy link
Collaborator

@rusty-snake rusty-snake commented Oct 31, 2021

Resolves #4642

  • test
  • go through the TODOs
  • add tests to meson
  • testing
  • gcov
  • decide what to do with autotools
  • did I said to test?

run: ninja -C _builddir
- name: meson install
run: sudo -E ninja -C _builddir install
# TODO: Why do we run this for profile changes?
Copy link
Collaborator

Choose a reason for hiding this comment

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

test-github: test-profiles test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment

the target was also running tests that use the profiles.

project('firejail', 'c',
license: 'GPL-2.0-or-later',
default_options: [
# -D_FORTIFY_SOURCE=2 requires optimization
Copy link
Collaborator

Choose a reason for hiding this comment

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

hm, is there not something like build profiles (debug / release)?
how would one build with optimization and without stripping the binaries?
and feed build flags from external?

Copy link
Collaborator

Choose a reason for hiding this comment

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

(i should probably read up some documentation about this ;) )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This are the default options that are used if you do not specify them on initial setup nor override them on an later configure.

meson [setup] -Dbuildtype=[plain|debug|debugoptimized|release|minsize] -Dstrip=[true|false] -Dc_args=-Werror=format-security <_builddir>

https://mesonbuild.com/Builtin-options.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

rpm -E %meson on Fedora 34 (the equivalent of %configure)
  CFLAGS="${CFLAGS:--O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection}" ; export CFLAGS ; 
  CXXFLAGS="${CXXFLAGS:--O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection}" ; export CXXFLAGS ; 
  FFLAGS="${FFLAGS:--O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules}" ; export FFLAGS ; 
  FCFLAGS="${FCFLAGS:--O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules}" ; export FCFLAGS ; 
  LDFLAGS="${LDFLAGS:--Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld }" ; export LDFLAGS ; 
  LT_SYS_LIBRARY_PATH="${LT_SYS_LIBRARY_PATH:-/usr/lib64:}" ; export LT_SYS_LIBRARY_PATH ; 
  CC="${CC:-gcc}" ; export CC ; 
  CXX="${CXX:-g++}" ; export CXX 
    /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload --auto-features=enabled . x86_64-redhat-linux-gnu

src/man/meson.build Outdated Show resolved Hide resolved
@rusty-snake rusty-snake deleted the meson branch October 30, 2022 16:04
@topimiettinen
Copy link
Collaborator

@rusty-snake perhaps conversion to meson should deserve to get new interest since a key part of xz-utils attack was to hide malicious features in the spaghetti of autotools?

@rusty-snake
Copy link
Collaborator Author

I don't have the time (and interest) todo this, but if anyone wants to pick up this PR ...

topimiettinen added a commit to topimiettinen/firejail that referenced this pull request Apr 13, 2024
Rebased and updated from netblue30#4656 by rusty-snake.
@topimiettinen topimiettinen mentioned this pull request Apr 13, 2024
topimiettinen added a commit to topimiettinen/firejail that referenced this pull request Apr 14, 2024
Rebased and updated from netblue30#4656 by rusty-snake.
topimiettinen added a commit to topimiettinen/firejail that referenced this pull request Apr 14, 2024
Rebased and updated from netblue30#4656 by rusty-snake.
topimiettinen added a commit to topimiettinen/firejail that referenced this pull request Apr 14, 2024
Rebased and updated from netblue30#4656 by rusty-snake.
topimiettinen added a commit to topimiettinen/firejail that referenced this pull request Apr 14, 2024
Rebased and updated from netblue30#4656 by rusty-snake.
topimiettinen added a commit to topimiettinen/firejail that referenced this pull request Apr 14, 2024
Rebased and updated from netblue30#4656 by rusty-snake.

Closes: netblue30#4642
topimiettinen added a commit to topimiettinen/firejail that referenced this pull request Apr 14, 2024
Rebased and updated from netblue30#4656 by rusty-snake.

Closes: netblue30#4642
topimiettinen added a commit to topimiettinen/firejail that referenced this pull request Apr 14, 2024
Rebased and updated from netblue30#4656 by rusty-snake.

Closes: netblue30#4642
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.

Switch from autotools to meson
3 participants