Article View: comp.sys.next.misc
Article #5080Re: M68000 Code to be generated using C on the NeXT
From: Sam C. Nicholson !!
Date: Tue, 16 Feb 1993 20:00
Date: Tue, 16 Feb 1993 20:00
57 lines
3152 bytes
3152 bytes
Here is a short driver for the gcc which we use to produce code for
our embedded 68000 product. It was written by Keith Moore at the
U. of Tenn. Knoxville.
-------------------------------------------
/*
* This is a hack to allow one to run the GNU C Compiler (gcc) with
* a reasonable set of arguments to allow it to produce code for
* a mc68000 (not an -020) to be used in a standalone environment.
*/
#include <stdio.h>
main (argc, argv, envp)
char **argv, **envp;
{
int i, j;
int vflag = 0;
char *new_argv[500]; /* have room for lotsa args */
i = 0;
new_argv[i++] = "gcc";
new_argv[i++] = "-nostdlib"; /* don't link in standard libraries */
new_argv[i++] = "-m68000"; /* generate code for MC68000 */
new_argv[i++] = "-msoft-float"; /* don't use FPA or FP chip */
new_argv[i++] = "-static"; /* don't use dynamic loading */
new_argv[i++] = "-nostdinc"; /* don't include standard .h files */
new_argv[i++] = "-I/usr/local/lib/cc68k-include";
/* do include our .h files */
new_argv[i++] = "-L/usr/local/lib/cc68k-lib";
/* where we put our libraries */
new_argv[i++] = "-Usun"; /* undefine "sun" macro */
new_argv[i++] = "-Uunix"; /* undefine "unix" macro */
/*
* append the arguments we were supplied on our command line to the ones
* we have defined above
*/
for (j = 1; j <= argc; ++j) { /* also copy NULL ptr at argv[argc] */
new_argv[i++] = argv[j];
if (j < argc && strcmp (argv[j], "-v") == 0)
vflag = 1;
}
if (vflag) {
putc (' ', stderr);
for (i = 0; new_argv[i]; ++i)
fprintf (stderr, "%s%c", new_argv[i], new_argv[i+1] ? ' ' : '\n');
}
execve ("/usr/local/bin/gcc", new_argv, envp);
perror ("/usr/local/bin/gcc");
exit (127);
}
-------------------------------------------------------
enjoy
-sam
scion@netimage.com
Technical Details
Message-ID:
<lo2hvfINNebt@utkcs2.cs.utk.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!howland.reston.ans.net!gatech!swrinde!emory!cs.utk.edu!cs.utk.edu!usenetReferences:
<0fTsX6600WB=MZSaEg@andrew.cmu.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,91e5ade98e8c2c1e X-Google-Attributes: gid11318c,public X-Google-Thread: feb3e,91e5ade98e8c2c1e X-Google-Attributes: gidfeb3e,public X-Google-Thread: 1035b6,91e5ade98e8c2c1e X-Google-Attributes: gid1035b6,public X-Google-Thread: f9256,91e5ade98e8c2c1e X-Google-Attributes: gidf9256,public X-Google-ArrivalTime: 1993-02-16 12:00:47 PST Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!agate!howland.reston.ans.net!gatech!swrinde!emory!cs.utk.edu!cs.utk.edu!usenet From: scion@netimage.com (Sam C. Nicholson !!) Newsgroups: comp.sys.next.misc,comp.sys.next.programmer,gnu.gcc.help,comp.sys.m68k Subject: Re: M68000 Code to be generated using C on the NeXT Followup-To: comp.sys.next.misc Date: 16 Feb 93 20:00:47 GMT Organization: Network Imaging Systems Corporation - Reston, VA. Lines: 58 Distribution: usa Message-ID: <lo2hvfINNebt@utkcs2.cs.utk.edu> References: <0fTsX6600WB=MZSaEg@andrew.cmu.edu> NNTP-Posting-Host: utkcs2.cs.utk.edu Keywords: gcc 68000 (only) driver