All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 9/9] cgcc: remove now unneeded options & defines
Date: Thu,  9 Jul 2020 01:41:51 +0200	[thread overview]
Message-ID: <20200708234151.57845-10-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20200708234151.57845-1-luc.vanoostenryck@gmail.com>

Now that the OS can be specified to sparse via an option (--os=$OS)
and that sparse knows about their specificities, it's no more
needed or useful to also define them in cgcc.

So, remove from cgcc the OS-specificities known to sparse (a few
few exotic ones remain for now) but ensure that the info about
the correct OS is passed to sparse.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 cgcc | 32 ++++++++------------------------
 1 file changed, 8 insertions(+), 24 deletions(-)

diff --git a/cgcc b/cgcc
index 9c6ad88367c1..cc356701380a 100755
--- a/cgcc
+++ b/cgcc
@@ -221,48 +221,32 @@ sub float_types {
 sub add_specs {
     my ($spec) = @_;
     if ($spec eq 'sunos') {
-	return &add_specs ('unix') .
-	    ' -D__sun__=1 -D__sun=1 -Dsun=1' .
-	    ' -D__svr4__=1 -DSVR4=1' .
+	return " --os=$specs" .
+	    ' -DSVR4=1' .
 	    ' -D__STDC__=0' .
 	    ' -D_REENTRANT' .
 	    ' -D_SOLARIS_THREADS' .
 	    ' -DNULL="((void *)0)"';
     } elsif ($spec eq 'linux') {
-	return &add_specs ('unix') .
-	    ' -D__linux__=1 -D__linux=1 -Dlinux=1';
+	return " --os=$specs";
     } elsif ($spec eq 'gnu/kfreebsd') {
 	return &add_specs ('unix') .
 	    ' -D__FreeBSD_kernel__=1';
     } elsif ($spec eq 'openbsd') {
-	return &add_specs ('unix') .
-	    ' -D__OpenBSD__=1';
+	return " --os=$specs";
     } elsif ($spec eq 'freebsd') {
-	return &add_specs ('unix') .
-	    ' -D__FreeBSD__=1';
+	return " --os=$specs";
     } elsif ($spec eq 'netbsd') {
-	return &add_specs ('unix') .
-	    ' -D__NetBSD__=1';
+	return " --os=$specs";
     } elsif ($spec eq 'darwin') {
-	return
-	    ' -D__APPLE__=1 -D__APPLE_CC__=1 -D__MACH__=1';
+	return " --os=$specs";
     } elsif ($spec eq 'gnu') {		# Hurd
 	return &add_specs ('unix') .	# So, GNU is Unix, uh?
 	    ' -D__GNU__=1 -D__gnu_hurd__=1 -D__MACH__=1';
     } elsif ($spec eq 'unix') {
 	return ' -Dunix=1 -D__unix=1 -D__unix__=1';
     } elsif ( $spec =~ /^cygwin/) {
-	return &add_specs ('unix') .
-	    ' -fshort-wchar' .
-	    ' -D__CYGWIN__=1' .
-	    ($m32 ? ' -D__CYGWIN32__=1' : '') .
-	    " -D'_cdecl=__attribute__((__cdecl__))'" .
-	    " -D'__cdecl=__attribute__((__cdecl__))'" .
-	    " -D'_stdcall=__attribute__((__stdcall__))'" .
-	    " -D'__stdcall=__attribute__((__stdcall__))'" .
-	    " -D'_fastcall=__attribute__((__fastcall__))'" .
-	    " -D'__fastcall=__attribute__((__fastcall__))'" .
-	    " -D'__declspec(x)=__attribute__((x))'";
+	return ' --os=cygwin';
     } elsif ($spec eq 'i386') {
 	$m32 = 1;
 	return (
-- 
2.27.0


      parent reply	other threads:[~2020-07-08 23:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 23:41 [PATCH 0/9] OS-specific small fixes & cleanup Luc Van Oostenryck
2020-07-08 23:41 ` [PATCH 1/9] x86: reorg the target file Luc Van Oostenryck
2020-07-08 23:41 ` [PATCH 2/9] arch: add an option to specify the OS: --os=$OS Luc Van Oostenryck
2020-07-08 23:41 ` [PATCH 3/9] predefine: add __linux__ & __linux Luc Van Oostenryck
2020-07-08 23:41 ` [PATCH 4/9] predefine: no __unix__ for Darwin Luc Van Oostenryck
2020-07-08 23:41 ` [PATCH 5/9] x86: fixes types for NetBSD & OpenBSD Luc Van Oostenryck
2020-07-08 23:41 ` [PATCH 6/9] sparc: char are unsigned on Solaris Luc Van Oostenryck
2020-07-08 23:41 ` [PATCH 7/9] arch: add predefines for OS identification Luc Van Oostenryck
2020-07-08 23:41 ` [PATCH 8/9] cygwin: add the predefines '__cdecl', Luc Van Oostenryck
2020-07-08 23:41 ` Luc Van Oostenryck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200708234151.57845-10-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.