eworm-de / mkinitcpio-ykfde

Full disk encryption with Yubikey (Yubico key)
GNU General Public License v3.0
109 stars 26 forks source link

Fails to build from aur #33

Closed Nox-404 closed 3 years ago

Nox-404 commented 3 years ago

Hi, There's a warning that causes the build to fail on arch using the AUR package. It happens on both the git and standard version.

$ yay -S mkinitcpio-ykfde
:: There are 2 providers available for mkinitcpio-ykfde:
:: Repository AUR
    1) mkinitcpio-ykfde 2) mkinitcpio-ykfde-git

Enter a number (default=1): 2
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  mkinitcpio-ykfde-git-0.7.6.r4.g7ac4c16-1

  1 mkinitcpio-ykfde-git                     (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==>
:: PKGBUILD up to date, Skipping (1/1): mkinitcpio-ykfde-git
  1 mkinitcpio-ykfde-git                     (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> A

==> Proceed with install? [Y/n]
:: (1/1) Parsing SRCINFO: mkinitcpio-ykfde-git
==> Making package: mkinitcpio-ykfde-git 0.7.6.r4.g7ac4c16-1 (Fri 07 May 2021 10:59:05 PM CEST)
==> Retrieving sources...
  -> Updating mkinitcpio-ykfde git repo...
Fetching origin
==> Validating source files with sha256sums...
    mkinitcpio-ykfde ... Skipped
==> Making package: mkinitcpio-ykfde-git 0.7.6.r4.g7ac4c16-1 (Fri 07 May 2021 10:59:07 PM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating mkinitcpio-ykfde git repo...
Fetching origin
==> Validating source files with sha256sums...
    mkinitcpio-ykfde ... Skipped
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Creating working copy of mkinitcpio-ykfde git repo...
Cloning into 'mkinitcpio-ykfde'...
done.
==> Starting pkgver()...
==> Updated version: mkinitcpio-ykfde-git 0.7.7.r1.g9d6d51c-1
==> Sources are ready.
==> Making package: mkinitcpio-ykfde-git 0.7.7.r1.g9d6d51c-1 (Fri 07 May 2021 10:59:11 PM CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
cp config.def.h config.h
make -C bin worker
make[1]: Entering directory '/home/nox/.cache/yay/mkinitcpio-ykfde-git/src/mkinitcpio-ykfde/bin'
gcc worker.c -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS         -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -std=gnu11 -O2 -fPIC -Wall -Werror -liniparser -lkeyutils -lykpers-1 -lyubikey -lsystemd  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,-z,now -Wl,-z,relro -pie -o worker
make[1]: Leaving directory '/home/nox/.cache/yay/mkinitcpio-ykfde-git/src/mkinitcpio-ykfde/bin'
printf "#ifndef VERSION\n#define VERSION \"%s\"\n#endif\n" 0.7.7-1-g9d6d51c > version.h
make -C bin ykfde
make[1]: Entering directory '/home/nox/.cache/yay/mkinitcpio-ykfde-git/src/mkinitcpio-ykfde/bin'
gcc ykfde.c -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS         -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -std=gnu11 -O2 -fPIC -Wall -Werror -liniparser -lkeyutils -lykpers-1 -lyubikey -lsystemd  -lcryptsetup -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -Wl,-z,now -Wl,-z,relro -pie -o ykfde
ykfde.c: In function ‘main’:
ykfde.c:307:3: error: ignoring return value of ‘getrandom’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  307 |   getrandom((void *)((size_t)challenge_int + len), CHALLENGELEN * sizeof(unsigned int) - len, 0);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:17: ykfde] Error 1
make[1]: Leaving directory '/home/nox/.cache/yay/mkinitcpio-ykfde-git/src/mkinitcpio-ykfde/bin'
make: *** [Makefile:19: bin/ykfde] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
error making: mkinitcpio-ykfde-git
Execution time: 0h:00m:36s sec

Is there a fix ?

eworm-de commented 3 years ago

Wondering why this does not happen for me...

Nox-404 commented 3 years ago

It seems it's because of the following makepkg CFLAG : -D_FORTIFY_SOURCE=2

Nox-404 commented 3 years ago

It adds several checks to enhance program security such as overflow checks and arguments consistency...

Could you support building with this compile flag ?

Nox-404 commented 3 years ago

FYI my flags:

CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
        -Wp,-D_FORTIFY_SOURCE=2,-D_GLIBCXX_ASSERTIONS \
        -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"