Article View: gnu.gcc.help
Article #54341gcc and Posix systems
From: Scott Bartram
Date: Thu, 01 Nov 1990 20:31
Date: Thu, 01 Nov 1990 20:31
56 lines
2822 bytes
2822 bytes
I have modified gcc to accept a new switch called: -posix. This will
cause '-D_POSIX_SOURCE' to be passed to the preprocessor and ld
to use the Posix startup files and link with -lcposix before -lc. This
seems to work fine for Interactive (386/ix) 2.2 OS.
I'm wondering what other systems define in their OS headers for Posix
compliance. Is _POSIX_SOURCE a standard, or something unique to
Interactive? Do other Posix systems have separate startup files and
C libraries? Is it just too early to try and standardize Posix and gcc?
In any case, the diffs are pretty small so here they are:
-----------------------< CUT HERE >-------------------------
*** gcc.c-dist Thu Nov 1 15:27:57 1990
--- gcc.c Thu Nov 1 15:04:47 1990
***************
*** 233,238 ****
--- 233,239 ----
{".c",
"cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} %{trigraphs} -undef \
-D__GNUC__ %{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!ansi:%p} %P\
+ %{posix:-D_POSIX_SOURCE}\
%c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic}\
%{Wcomment*} %{Wtrigraphs} %{Wall} %C\
%i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%{o*}}%{M*:%{o*}} |\n\
*** config/tm-i386v.h-dist Thu Nov 1 14:54:59 1990
--- config/tm-i386v.h Thu Nov 1 14:57:30 1990
***************
*** 31,39 ****
/* Use crt1.o as a startup file and crtn.o as a closing file. */
#define STARTFILE_SPEC \
! "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
! #define LIB_SPEC "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} -lc crtn.o%s"
/* Specify predefined symbols in preprocessor. */
--- 31,40 ----
/* Use crt1.o as a startup file and crtn.o as a closing file. */
#define STARTFILE_SPEC \
! "%{pg:gcrt1.o%s}%{!pg:%{posix:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}%{!posix:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}"
! #define LIB_SPEC \
! "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} %{posix:-lcposix} %{shlib:-lc_s} -lc crtn.o%s"
/* Specify predefined symbols in preprocessor. */
scott
--
-----------------------------------------------------------------------
Scott Bartram UUCP: uunet!nancy!scott
Consultant VOICE: 703-968-6300
American Systems Corporation
Technical Details
Message-ID:
<1990Nov1.203154.18227@nancy.uucp>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!nancy!scottShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,3ae585beca75d273,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1990-11-01 12:31:54 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!nancy!scott From: scott@nancy.uucp (Scott Bartram) Newsgroups: gnu.gcc.help Subject: gcc and Posix systems Message-ID: <1990Nov1.203154.18227@nancy.uucp> Date: 1 Nov 90 20:31:54 GMT Sender: scott@nancy.uucp (Scott Bartram) Distribution: gnu Organization: American Systems Corporation Lines: 56 Posted: Thu Nov 1 21:31:54 1990