Package Details: mips-elf-gcc 12.2.0-1

Git Clone URL: https://aur.archlinux.org/mips-elf-gcc.git (read-only, click to copy)
Package Base: mips-elf-gcc
Description: The GNU Compiler Collection - cross compiler for MIPS ELF (bare-metal) target
Upstream URL: https://gcc.gnu.org/
Licenses: GPL
Conflicts: cross-mips-elf-gcc
Replaces: cross-mips-elf-gcc
Submitter: angelodalzotto
Maintainer: angelodalzotto
Last Packager: angelodalzotto
Votes: 5
Popularity: 0.012058
First Submitted: 2022-03-14 00:26 (UTC)
Last Updated: 2022-08-29 12:24 (UTC)

Latest Comments

1 2 Next › Last »

angelodalzotto commented on 2023-01-25 11:23 (UTC)

To use stdio.h (and other libraries) you may compile a standard C library, such as newlib.

dhims commented on 2023-01-25 07:19 (UTC)

After installation of package I am not able to build c code as it cannot find stdio.h. Any idea how to fix it? "fatal error: stdio.h: No such file or directory"

mthfrr commented on 2021-12-26 10:49 (UTC)

I had a similar problem as philpirj. The -Werror=format-security flag came from the config of makepkg (/etc/makepkg.conf).

I removed it and it works !

If someone cares, the CFLAGS set by default in makepkg.conf are:

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

This is a fresh arch install from the 2021.12 iso.

NigelCunningham commented on 2021-10-22 22:36 (UTC)

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 (UTC)

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 (UTC)

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 (UTC)

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 (UTC) (edited on 2021-06-09 09:31 (UTC) by philpirj)

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 (UTC)

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 (UTC)

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).