From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A1D9413835A for ; Sat, 20 Jun 2020 21:12:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A8DD9E086A; Sat, 20 Jun 2020 21:12:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4EFEBE086A for ; Sat, 20 Jun 2020 21:12:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2BF0834F644 for ; Sat, 20 Jun 2020 21:12:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 987462A0 for ; Sat, 20 Jun 2020 21:12:18 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1592687279.06f9083246c2d705520ab82e8bd822fd2428e12f.slyfox@gentoo> Subject: [gentoo-commits] proj/gcc-config:master commit in: tests/multi-native-configs/usr/share/gcc-config/, ... X-VCS-Repository: proj/gcc-config X-VCS-Files: .gitignore Makefile c89 c99 gcc-config tests/multi-native-configs/usr/share/gcc-config/c89 tests/multi-native-configs/usr/share/gcc-config/c99 tests/rw-multi-native-configs/usr/share/gcc-config/c89 tests/rw-multi-native-configs/usr/share/gcc-config/c99 X-VCS-Directories: tests/multi-native-configs/usr/share/gcc-config/ tests/rw-multi-native-configs/usr/share/gcc-config/ / X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: 06f9083246c2d705520ab82e8bd822fd2428e12f X-VCS-Branch: master Date: Sat, 20 Jun 2020 21:12:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bea1745c-c3b4-4e66-a067-d95d83283d4c X-Archives-Hash: d422698be99a08686c3c54bca143df4d commit: 06f9083246c2d705520ab82e8bd822fd2428e12f Author: Sergei Trofimovich gentoo org> AuthorDate: Sat Jun 20 21:07:59 2020 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Sat Jun 20 21:07:59 2020 +0000 URL: https://gitweb.gentoo.org/proj/gcc-config.git/commit/?id=06f90832 gcc-config: install /usr/bin/c{89,99}, take over from toolchain.eclass Reported-by: Kent Fredric Bug: https://bugs.gentoo.org/728722 Signed-off-by: Sergei Trofimovich gentoo.org> .gitignore | 2 ++ Makefile | 34 ++++++++++++++++++++-- c89 | 22 ++++++++++++++ c99 | 23 +++++++++++++++ gcc-config | 14 ++++++++- .../multi-native-configs/usr/share/gcc-config/c89 | 0 .../multi-native-configs/usr/share/gcc-config/c99 | 0 .../usr/share/gcc-config/c89 | 0 .../usr/share/gcc-config/c99 | 0 9 files changed, 91 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b79124b..44ddfac 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ /gcc-config-*.tar.* +/.c89 +/.c99 /.gcc-config diff --git a/Makefile b/Makefile index c74adec..61ba0d9 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,15 @@ # configurable options: + # Avoid installing native symlinks like: # /usr/bin/gcc -> ${CTARGET}-gcc # and keep only # ${CTARGET}-gcc USE_NATIVE_LINKS ?= yes +# Prepend toolchain prefix to 'gcc' in c89/c99 wrapeprs. +# Should usually be '${CHOST}-'. +TOOLCHAIN_PREFIX ?= + EPREFIX ?= PN = gcc-config @@ -14,6 +19,7 @@ P = $(PN)-$(PV) PREFIX = $(EPREFIX)/usr BINDIR = $(PREFIX)/bin DOCDIR = $(PREFIX)/share/doc/$(P) +SHAREDIR = $(PREFIX)/share/$(PN) ESELECTDIR = $(PREFIX)/share/eselect/modules SUBLIBDIR = lib @@ -23,10 +29,10 @@ MKDIR_P = mkdir -p -m 755 INSTALL_EXE = install -m 755 INSTALL_DATA = install -m 644 -all: .gcc-config +all: .gcc-config .c89 .c99 clean: - rm -f .gcc-config + rm -f .gcc-config .c89 .c99 .gcc-config: gcc-config sed \ @@ -38,9 +44,31 @@ clean: $< > $@ chmod a+rx $@ +.c89: c89 + sed \ + -e '1s:/:$(EPREFIX)/:' \ + -e 's:@PV@:$(PV):g' \ + -e 's:@TOOLCHAIN_PREFIX@:$(TOOLCHAIN_PREFIX):g' \ + $< > $@ + chmod a+rx $@ + +.c99: c99 + sed \ + -e '1s:/:$(EPREFIX)/:' \ + -e 's:@PV@:$(PV):g' \ + -e 's:@TOOLCHAIN_PREFIX@:$(TOOLCHAIN_PREFIX):g' \ + $< > $@ + chmod a+rx $@ + install: all - $(MKDIR_P) $(DESTDIR)$(BINDIR) $(DESTDIR)$(ESELECTDIR) $(DESTDIR)$(DOCDIR) + $(MKDIR_P) $(DESTDIR)$(BINDIR) $(DESTDIR)$(ESELECTDIR) $(DESTDIR)$(SHAREDIR) $(DESTDIR)$(DOCDIR) $(INSTALL_EXE) .gcc-config $(DESTDIR)$(BINDIR)/gcc-config + $(INSTALL_EXE) .c89 $(DESTDIR)$(SHAREDIR)/c89 + $(INSTALL_EXE) .c99 $(DESTDIR)$(SHAREDIR)/c99 + if [ "$(USE_NATIVE_LINKS)" = yes ] ; then \ + $(INSTALL_EXE) .c89 $(DESTDIR)$(BINDIR)/c89 && \ + $(INSTALL_EXE) .c99 $(DESTDIR)$(BINDIR)/c99 ; \ + fi $(INSTALL_DATA) gcc.eselect $(DESTDIR)$(ESELECTDIR) $(INSTALL_DATA) README $(DESTDIR)$(DOCDIR) diff --git a/c89 b/c89 new file mode 100755 index 0000000..34dcd60 --- /dev/null +++ b/c89 @@ -0,0 +1,22 @@ +#!/bin/sh + +# Managed by gcc-config-@PV@ + +# Call the appropriate C compiler with options to accept ANSI/ISO C +# The following options are the same (as of gcc-2.95): +# -ansi +# -std=c89 +# -std=iso9899:1990 + +for i; do + case "$i" in + -ansi|-std=c89|-std=iso9899:1990) + ;; + -std=*) + echo >&2 "`basename $0` called with non ANSI/ISO C90 option $i" + exit 1 + ;; + esac +done + +exec @TOOLCHAIN_PREFIX@gcc -std=c89 -pedantic -U_FORTIFY_SOURCE "$@" diff --git a/c99 b/c99 new file mode 100755 index 0000000..b013510 --- /dev/null +++ b/c99 @@ -0,0 +1,23 @@ +#!/bin/sh + +# Managed by gcc-config-@PV@ + +# Call the appropriate C compiler with options to accept ANSI/ISO C +# The following options are the same (as of gcc-3.3): +# -std=c99 +# -std=c9x +# -std=iso9899:1999 +# -std=iso9899:199x + +for i; do + case "$i" in + -std=c9[9x]|-std=iso9899:199[9x]) + ;; + -ansi|-std=*) + echo >&2 "`basename $0` called with non ANSI/ISO C99 option $i" + exit 1 + ;; + esac +done + +exec @TOOLCHAIN_PREFIX@gcc -std=c99 -pedantic -U_FORTIFY_SOURCE ${1+"$@"} diff --git a/gcc-config b/gcc-config index ad69b9b..d05dabe 100755 --- a/gcc-config +++ b/gcc-config @@ -330,7 +330,7 @@ update_wrappers() { # legacy cruft, make sure we dont leave it laying around #143205 rm -f "${EROOT}usr/bin/${CTARGET}-cc" "${EROOT}usr/bin"/{${CTARGET}-,}g{cc,++}{32,64} - # install the canonical cpp wrapper + # handle the canonical cpp wrapper if ! is_cross_compiler ; then if [[ ${USE_NATIVE_LINKS} == yes ]]; then atomic_ln "${EPREFIX%/}/usr/bin/${CTARGET}-cpp" "${EROOT}lib" "cpp" @@ -338,6 +338,18 @@ update_wrappers() { rm -f "${EROOT}lib/cpp" fi fi + + # handle c89 and c99 wrappers + if ! is_cross_compiler ; then + if [[ ${USE_NATIVE_LINKS} == yes ]]; then + # In June 2020 gcc-config taken over file handling from toolchain.eclass. + cp -fpP "${EROOT}"usr/share/gcc-config/c89 "${EROOT}"usr/bin/c89 + cp -fpP "${EROOT}"usr/share/gcc-config/c99 "${EROOT}"usr/bin/c99 + else + rm -f "${EROOT}"usr/bin/c89 + rm -f "${EROOT}"usr/bin/c99 + fi + fi } mv_if_diff() { diff --git a/tests/multi-native-configs/usr/share/gcc-config/c89 b/tests/multi-native-configs/usr/share/gcc-config/c89 new file mode 100644 index 0000000..e69de29 diff --git a/tests/multi-native-configs/usr/share/gcc-config/c99 b/tests/multi-native-configs/usr/share/gcc-config/c99 new file mode 100644 index 0000000..e69de29 diff --git a/tests/rw-multi-native-configs/usr/share/gcc-config/c89 b/tests/rw-multi-native-configs/usr/share/gcc-config/c89 new file mode 100644 index 0000000..e69de29 diff --git a/tests/rw-multi-native-configs/usr/share/gcc-config/c99 b/tests/rw-multi-native-configs/usr/share/gcc-config/c99 new file mode 100644 index 0000000..e69de29