Package Details: cross-mips-elf-gcc 11.1.0-1

Git Clone URL: https://aur.archlinux.org/cross-mips-elf-gcc.git (read-only, click to copy)
Package Base: cross-mips-elf-gcc
Description: The GNU Compiler Collection for the MIPS-elf architecture
Upstream URL: http://www.gnu.org/software/gcc/
Licenses: GPL
Submitter: EoleDev
Maintainer: angelodalzotto
Last Packager: angelodalzotto
Votes: 4
Popularity: 0.059961
First Submitted: 2015-10-23 11:44
Last Updated: 2021-05-07 21:56

Latest Comments

NigelCunningham commented on 2021-10-22 22:36

I have been able to reproduce the issue for the last few months.

What packages & configuration might influence the build to cause this?

angelodalzotto commented on 2021-07-12 10:55

I can't reproduce the build error as its building just fine for me without applying any patches.

About the signature, you may import the key:

gpg --recv-keys 6C35B99309B5FA62

philpirj commented on 2021-06-27 14:01

Alright, there's https://github.com/archlinux/svntogit-packages/blob/packages/gcc/trunk/gcc11-Wno-format-security.patch in the core gcc package.

It should be applied as well to cross-mips-elf-gcc like this (see https://github.com/archlinux/svntogit-packages/blob/c0c9a945c11d1868af6d4dbcef985319ee153ea3/trunk/PKGBUILD#L31):

source=(https://sourceware.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.xz{,.sig}
        gcc11-Wno-format-security.patch
)

Also, add:

  # configure.ac: When adding -Wno-format, also add -Wno-format-security
  patch -Np0 < "$srcdir/gcc11-Wno-format-security.patch"

to prepare().

It is, however, still insufficient, as the error is detected in libcpp, while we've patched the root configure.ac.

What helps is the removal of:

enable_werror_always

from src/gcc-11.1.0/libcpp/configure. However, I don't really understand what from src/gcc-11.1.0/libcpp/configure.ac adds it, and can't create an includable patch.

After removing this nasty option, I could manually build GCC. Next:

src/gcc-11.1.0 $ make DESTDIR=/home/pirj/source/tmp/cross-mips-elf-gcc/pkg install-gcc
$ cd ../..
$ makepkg --repackage

failed with:

find: ‘/home/pirj/source/tmp/cross-mips-elf-gcc/pkg/cross-mips-elf-gcc/usr/bin/’: No such file or directory

as it creates usr/local/bin, not usr/bin:

$ ls pkg/cross-mips-elf-gcc/usr/local/
bin/      include/  lib/      libexec/  share/

philpirj commented on 2021-06-09 08:46

Getting a compilation error now:

make[1]: Entering directory '/home/pirj/source/tmp/cross-mips-elf-gcc/src/gcc-11.1.0/build-x86_64-pc-linux-gnu/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
g++  -I../.././libcpp -I. -I../.././libcpp/../include -I../.././libcpp/include  -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 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long  -fno-exceptions -fno-rtti -I../.././libcpp -I. -I../.././libcpp/../include -I../.././libcpp/include    -c -o expr.o -MT expr.o -MMD -MP -MF .deps/expr.Tpo ../.././libcpp/expr.c
../.././libcpp/expr.c: In function ‘unsigned int cpp_classify_number(cpp_reader*, const cpp_token*, const char**, location_t)’:
../.././libcpp/expr.c:811:35: error: format not a string literal and no format arguments [-Werror=format-security]
  811 |             cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location,
      |             ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  812 |                                    0, message);
      |                                    ~~~~~~~~~~~
../.././libcpp/expr.c:814:38: error: format not a string literal and no format arguments [-Werror=format-security]
  814 |             cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
  815 |                                       virtual_location, 0, message);
      |                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../.././libcpp/expr.c:824:33: error: format not a string literal and no format arguments [-Werror=format-security]
  824 |           cpp_warning_with_line (pfile, CPP_W_SIZE_T_LITERALS,
      |           ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  825 |                                  virtual_location, 0, message);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
make[1]: *** [Makefile:226: expr.o] Error 1
make[1]: Leaving directory '/home/pirj/source/tmp/cross-mips-elf-gcc/src/gcc-11.1.0/build-x86_64-pc-linux-gnu/libcpp'

philpirj commented on 2021-06-09 08:43

From Jakub:

Older releases I've signed are with the older key (now expired), the newer with the newer key, both have correct fingerprints on that mirrors.html and both are uploaded to multiple key servers.

ftp://ftp.gnu.org/gnu/gcc/gcc-11.1.0/gcc-11.1.0.tar.gz.sig is signed with 6C35.

There are no separate 6C35 and D3A9 keys, that is a single key with D3A9 3CAD 751C 2AF4 F8C7 AD51 6C35 B993 09B5 FA62 fingerprint. http://keys.gnupg.net/pks/lookup?op=get&search=0x6C35B99309B5FA62 is the nwer one and http://keys.gnupg.net/pks/lookup?op=get&search=0xA328C3A2C3C45C06 is the older one.


It seems to have been a problem with my user keyring. Resolved.

philpirj commented on 2021-06-08 09:56

https://aur.archlinux.org/packages/libgccjit/#comment-808549 suggests importing this key:

gpg --recv-keys 6C35B99309B5FA62

but frankly I don't understand why one do that, and why this signature should be trusted?

gpg: key 6C35B99309B5FA62: public key "Jakub Jelinek <jakub@redhat.com>" imported

Checked with Jakub to update their signature on GNU FTP mirrors page.

Anyway, after importing:

$ gpg --verify-files gcc-11.1.0.tar.gz.sig gcc-11.1.0.tar.gz
gpg: assuming signed data in 'gcc-11.1.0.tar.gz'
gpg: Signature made Tue 27 Apr 2021 01:39:54 PM +03
gpg:                using RSA key 6C35B99309B5FA62
gpg: BAD signature from "Jakub Jelinek <jakub@redhat.com>" [unknown]
gpg: no valid OpenPGP data found.
gpg: verify files failed: Unknown system error

philpirj commented on 2021-06-08 09:47

Didn't work.

gpg: Signature made Tue 27 Apr 2021 01:39:54 PM +03
gpg:                using RSA key 6C35B99309B5FA62

It still fails the check even if I add this 6C35 key to validpgpkeys (desperate mode alert).

philpirj commented on 2021-06-08 09:37

According to http://www.gnu.org/software/gcc/mirrors.html, there are more valid signing keys.

validpgpkeys=('B215C1633BCA0477615F1B35A5B3A004745C015A'
              'B3C42148A44E6983B3E4CC0793FA9B1AB75C61B8'
              '90AA470469D3965A87A5DCB494D03953902C9419'
              '80F98B2E0DAB6C8281BDF541A7C8C3B2F71EDF1C'
              '7F74F97C103468EE5D750B583AB00996FC26A641'
              '33C235A34C46AA3FFB293709A328C3A2C3C45C06'
              'D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62')

should work.

philpirj commented on 2021-06-08 08:52

==> Validating source files with md5sums...
    gcc-11.1.0.tar.gz ... Passed
    gcc-11.1.0.tar.gz.sig ... Skipped
==> Verifying source file signatures with gpg...
    gcc-11.1.0.tar.gz ... FAILED (unknown public key 6C35B99309B5FA62)
==> ERROR: One or more PGP signatures could not be verified!
warning: package cross-mips-elf-gcc failed to build, skipping

ecloud commented on 2019-09-08 07:17

Is this intended as a bare-metal compiler? It seems incomplete for building binaries for openwrt... that's what I was hoping to use it for. Of course there are no headers included, and even if I work around that, I see that it's not able to link a "hello world" executable:

$ mips-elf-gcc -I/usr/include hello.c -o hello-mips
hello.c: In function 'main':
hello.c:6:5: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
     exit(42);
     ^
hello.c:6:5: warning: incompatible implicit declaration of built-in function 'exit'
hello.c:6:5: note: include '<stdlib.h>' or provide a declaration of 'exit'
/usr/lib/cross-mips-elf/lib/gcc/mips-elf/5.4.0/../../../../mips-elf/bin/ld: cannot find crti.o: No such file or directory
/usr/lib/cross-mips-elf/lib/gcc/mips-elf/5.4.0/../../../../mips-elf/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/lib/cross-mips-elf/lib/gcc/mips-elf/5.4.0/../../../../mips-elf/bin/ld: cannot find -lgcc
/usr/lib/cross-mips-elf/lib/gcc/mips-elf/5.4.0/../../../../mips-elf/bin/ld: cannot find -lgcc
/usr/lib/cross-mips-elf/lib/gcc/mips-elf/5.4.0/../../../../mips-elf/bin/ld: cannot find crtend.o: No such file or directory
/usr/lib/cross-mips-elf/lib/gcc/mips-elf/5.4.0/../../../../mips-elf/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status