public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] powerpc-eabi board support for Xilinx
@ 2008-10-22 19:38 Michael Eager
  2008-11-04 21:35 ` Michael Meissner
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Eager @ 2008-10-22 19:38 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]

I've been somewhat annoyed that when gcc is built with
--target=powerpc-*-eabi, I need to specify a target board with
-m<board> each time I run gcc to create an executable.  This
is not the case with --target=powerpc-eabisim, since this
configuration uses config/rs6000/eabisim.h to overwrite the
target options in config/rs6000/sysv4.h to force sim to be
the default.

The attached patch does two things:  First, it creates a
--with-board=<board> option which will set the default
target board for a build with --target=powerpc-*-eabi.  The
user can still override this with a -m<board> option.  Second,
it creates -mxilinx, which specifies target options for
using various Xilinx PowerPC development boards.

[It's arguable whether any of this should be in sysv4.h,
or whether there should be different build configurations
for the various boards, like is done with powerpc-eabisim.
But this patch maintains compatibility with past builds.]


-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

[-- Attachment #2: changelog --]
[-- Type: text/plain, Size: 1267 bytes --]

2008-10-22  Michael Eager <eager@eagercon.com>

	* config/rs6000/sysv4.h: CONCAT3, _CONCAT3: define.
	LINK_START_DEFAULT_SPEC, LINK_OS_DEFAULT_SPEC, CPP_OS_DEFAULT_SPEC,
	STARTFILE_DEFAULT_SPEC, LIB_DEFAULT_SPEC, ENDFILE_DEFAULT_SPEC:
	define using TARGET_BOARD_DEFAULT if defined.
	link_start_xilinx, link_os_linux, cpp_os_xilinx, startfile_xilinx,
	lib_xilinx, endfile_xilinx: define Xilinx board support.
	LIBGCC_SPEC, libgcc_default: make libgcc conditional on -m options
	LIBGCC_ADS_SPEC, LIBGCC_YELLOWKNIFE_SPEC, LIBGCC_MVME_SPEC, 
	LIBGCC_SIM_SPEC, LIBGCC_FREEBSD_SPEC, LIBGCC_LINUX_SPEC, 
	LIBGCC_GNU_SPEC, LIBGCC_NETBSD_SPEC, LIBGCC_OPENBSD_SPEC: define.
	LIB_XILINX_SPEC, CPP_OS_XILINX_SPEC, STARTFILE_XILINX_SPEC, 
	ENDFILE_XILINX_SPEC, LINK_START_XILINX_SPEC, LINK_OS_XILINX_SPEC,
	LIBGCC_XILINX_SPEC: define Xilinx board support.
	* config/rs6000/sysv4.opt: add mxilinx board option
	* config.gcc: target_board_default: set by -with-board=.
	Check valid -with-board options.
	* configure: regenerate
	* configure.ac: target_board_default: define
	* doc/install.texi: describe -with-board configure option.
	describe -mxilinx option.
	* Makefile.in (cs-tm.h): TARGET_BOARD_DEFAULT set from 
	target_board_default
	* mkconfig.sh: set TARGET_BOARD_DEFAULT


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: gcc.patch --]
[-- Type: text/x-patch; name="gcc.patch", Size: 25052 bytes --]

diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn gcc-orig/gcc/config/rs6000/sysv4.h gcc/gcc/config/rs6000/sysv4.h
--- gcc-orig/gcc/config/rs6000/sysv4.h	2008-10-22 10:07:45.000000000 -0700
+++ gcc/gcc/config/rs6000/sysv4.h	2008-10-22 10:09:05.000000000 -0700
@@ -19,6 +19,9 @@
    along with GCC; see the file COPYING3.  If not see
    <http://www.gnu.org/licenses/>.  */
 
+#define CONCAT3(A,B,C)       _CONCAT3(A,B,C)
+#define _CONCAT3(A,B,C)      A##B##C
+
 /* Header files should be C++ aware in general.  */
 #undef  NO_IMPLICIT_EXTERN_C
 #define NO_IMPLICIT_EXTERN_C
@@ -599,6 +602,12 @@ SVR4_ASM_SPEC \
   mcall-gnu             :-mbig;    \
   mcall-i960-old        :-mlittle}"
 
+#ifdef TARGET_BOARD_DEFAULT
+#define	LIBGCC_DEFAULT_SPEC CONCAT3(LIBGCC_,TARGET_BOARD_DEFAULT,_SPEC)
+#else 
+#define LIBGCC_DEFAULT_SPEC "-lgcc"
+#endif
+
 #define	CC1_ENDIAN_BIG_SPEC ""
 
 #define	CC1_ENDIAN_LITTLE_SPEC "\
@@ -663,6 +672,7 @@ SVR4_ASM_SPEC \
   myellowknife : %(link_start_yellowknife) ; \
   mmvme        : %(link_start_mvme)        ; \
   msim         : %(link_start_sim)         ; \
+  mxilinx      : %(link_start_xilinx)      ; \
   mcall-freebsd: %(link_start_freebsd)     ; \
   mcall-linux  : %(link_start_linux)       ; \
   mcall-gnu    : %(link_start_gnu)         ; \
@@ -670,7 +680,11 @@ SVR4_ASM_SPEC \
   mcall-openbsd: %(link_start_openbsd)     ; \
                : %(link_start_default)     }"
 
+#ifdef TARGET_BOARD_DEFAULT
+#define	LINK_START_DEFAULT_SPEC CONCAT3(LINK_START_,TARGET_BOARD_DEFAULT,_SPEC)
+#else
 #define LINK_START_DEFAULT_SPEC ""
+#endif
 
 /* Override svr4.h definition.  */
 #undef	LINK_SPEC
@@ -720,6 +734,7 @@ SVR4_ASM_SPEC \
   myellowknife : %(link_os_yellowknife) ; \
   mmvme        : %(link_os_mvme)        ; \
   msim         : %(link_os_sim)         ; \
+  mxilinx      : %(link_os_xilinx)      ; \
   mcall-freebsd: %(link_os_freebsd)     ; \
   mcall-linux  : %(link_os_linux)       ; \
   mcall-gnu    : %(link_os_gnu)         ; \
@@ -727,7 +742,11 @@ SVR4_ASM_SPEC \
   mcall-openbsd: %(link_os_openbsd)     ; \
                : %(link_os_default)     }"
 
+#ifdef TARGET_BOARD_DEFAULT
+#define	LINK_OS_DEFAULT_SPEC CONCAT3(LINK_OS_,TARGET_BOARD_DEFAULT,_SPEC)
+#else
 #define LINK_OS_DEFAULT_SPEC ""
+#endif
 
 #define DRIVER_SELF_SPECS "%{mfpu=none: %<mfpu=* \
  	%<msingle-float %<mdouble-float}"
@@ -739,6 +758,7 @@ SVR4_ASM_SPEC \
   myellowknife : %(cpp_os_yellowknife) ; \
   mmvme        : %(cpp_os_mvme)        ; \
   msim         : %(cpp_os_sim)         ; \
+  mxilinx      : %(cpp_os_xilinx)      ; \
   mcall-freebsd: %(cpp_os_freebsd)     ; \
   mcall-linux  : %(cpp_os_linux)       ; \
   mcall-gnu    : %(cpp_os_gnu)         ; \
@@ -746,7 +766,11 @@ SVR4_ASM_SPEC \
   mcall-openbsd: %(cpp_os_openbsd)     ; \
                : %(cpp_os_default)     }"
 
+#ifdef TARGET_BOARD_DEFAULT
+#define	CPP_OS_DEFAULT_SPEC CONCAT3(CPP_OS_,TARGET_BOARD_DEFAULT,_SPEC)
+#else
 #define	CPP_OS_DEFAULT_SPEC ""
+#endif
 
 /* Override svr4.h definition.  */
 #undef	STARTFILE_SPEC
@@ -755,6 +779,7 @@ SVR4_ASM_SPEC \
   myellowknife : %(startfile_yellowknife) ; \
   mmvme        : %(startfile_mvme)        ; \
   msim         : %(startfile_sim)         ; \
+  mxilinx      : %(startfile_xilinx)      ; \
   mcall-freebsd: %(startfile_freebsd)     ; \
   mcall-linux  : %(startfile_linux)       ; \
   mcall-gnu    : %(startfile_gnu)         ; \
@@ -762,7 +787,11 @@ SVR4_ASM_SPEC \
   mcall-openbsd: %(startfile_openbsd)     ; \
                : %(startfile_default)     }"
 
+#ifdef TARGET_BOARD_DEFAULT
+#define	STARTFILE_DEFAULT_SPEC CONCAT3(STARTFILE_,TARGET_BOARD_DEFAULT,_SPEC)
+#else
 #define	STARTFILE_DEFAULT_SPEC "ecrti.o%s crtbegin.o%s"
+#endif
 
 /* Override svr4.h definition.  */
 #undef	LIB_SPEC
@@ -771,6 +800,7 @@ SVR4_ASM_SPEC \
   myellowknife : %(lib_yellowknife) ; \
   mmvme        : %(lib_mvme)        ; \
   msim         : %(lib_sim)         ; \
+  mxilinx      : %(lib_xilinx)      ; \
   mcall-freebsd: %(lib_freebsd)     ; \
   mcall-linux  : %(lib_linux)       ; \
   mcall-gnu    : %(lib_gnu)         ; \
@@ -778,7 +808,11 @@ SVR4_ASM_SPEC \
   mcall-openbsd: %(lib_openbsd)     ; \
                : %(lib_default)     }"
 
+#ifdef TARGET_BOARD_DEFAULT
+#define	LIB_DEFAULT_SPEC CONCAT3(LIB_,TARGET_BOARD_DEFAULT,_SPEC)
+#else
 #define LIB_DEFAULT_SPEC "-lc"
+#endif
 
 /* Override svr4.h definition.  */
 #undef	ENDFILE_SPEC
@@ -787,6 +821,7 @@ SVR4_ASM_SPEC \
   myellowknife : %(endfile_yellowknife) ; \
   mmvme        : %(endfile_mvme)        ; \
   msim         : %(endfile_sim)         ; \
+  mxilinx      : %(endfile_xilinx)      ; \
   mcall-freebsd: %(endfile_freebsd)     ; \
   mcall-linux  : %(endfile_linux)       ; \
   mcall-gnu    : %(endfile_gnu)         ; \
@@ -796,7 +831,27 @@ SVR4_ASM_SPEC \
 
 #define CRTSAVRES_DEFAULT_SPEC ""
 
-#define	ENDFILE_DEFAULT_SPEC "crtend.o%s ecrtn.o%s"
+#ifdef TARGET_BOARD_DEFAULT
+#define ENDFILE_DEFAULT_SPEC CONCAT3(ENDFILE_,TARGET_BOARD_DEFAULT,_SPEC)
+#else
+#define ENDFILE_DEFAULT_SPEC "crtend.o%s ecrtn.o%s"
+#endif
+
+/* Override definition.  */
+#undef	LIBGCC_SPEC
+#define	LIBGCC_SPEC "\
+%{mads         : -lgcc		    ; \
+  myellowknife : -lgcc		    ; \
+  mmvme        : -lgcc		    ; \
+  msim         : -lgcc		    ; \
+  mwindiss     : -lgcc		    ; \
+  mxilinx      : %(libgcc_xilinx)   ; \
+  mcall-freebsd: -lgcc		    ; \
+  mcall-linux  : -lgcc		    ; \
+  mcall-gnu    : -lgcc		    ; \
+  mcall-netbsd : -lgcc		    ; \
+  mcall-openbsd: -lgcc		    ; \
+               : %(libgcc_default)  }"
 
 /* Motorola ADS support.  */
 #define LIB_ADS_SPEC "--start-group -lads -lc --end-group"
@@ -811,6 +866,8 @@ SVR4_ASM_SPEC \
 
 #define CPP_OS_ADS_SPEC ""
 
+#define LIBGCC_ADS_SPEC "-lgcc"
+
 /* Motorola Yellowknife support.  */
 #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group"
 
@@ -824,6 +881,8 @@ SVR4_ASM_SPEC \
 
 #define CPP_OS_YELLOWKNIFE_SPEC ""
 
+#define LIBGCC_YELLOWKNIFE_SPEC "-lgcc"
+
 /* Motorola MVME support.  */
 #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group"
 
@@ -837,6 +896,8 @@ SVR4_ASM_SPEC \
 
 #define CPP_OS_MVME_SPEC ""
 
+#define LIBGCC_MVME_SPEC "-lgcc"
+
 /* PowerPC simulator based on netbsd system calls support.  */
 #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
 
@@ -850,8 +911,9 @@ SVR4_ASM_SPEC \
 
 #define CPP_OS_SIM_SPEC ""
 
-/* FreeBSD support.  */
+#define LIBGCC_SIM_SPEC "-lgcc"
 
+/* FreeBSD support.  */
 #define CPP_OS_FREEBSD_SPEC	"\
   -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
   -Acpu=powerpc -Amachine=powerpc"
@@ -873,6 +935,8 @@ SVR4_ASM_SPEC \
     %{static:-Bstatic}} \
   %{symbolic:-Bsymbolic}"
 
+#define LIBGCC_FREEBSD_SPEC "-lgcc"
+
 /* GNU/Linux support.  */
 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
 %{!mnewlib: %{pthread:-lpthread} %{shared:-lc} \
@@ -921,6 +985,8 @@ SVR4_ASM_SPEC \
     %{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}}		  \
 -Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
 
+#define LIBGCC_LINUX_SPEC "-lgcc"
+
 /* GNU/Hurd support.  */
 #define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
 %{!mnewlib: %{shared:-lc} %{!shared: %{pthread:-lpthread } \
@@ -946,6 +1012,8 @@ SVR4_ASM_SPEC \
   %{!ansi: -Dunix -D__unix}}			                \
 -Asystem=gnu -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
 
+#define LIBGCC_GNU_SPEC "-lgcc"
+
 /* NetBSD support.  */
 #define LIB_NETBSD_SPEC "\
 %{profile:-lgmon -lc_p} %{!profile:-lc}"
@@ -969,6 +1037,8 @@ ncrtn.o%s"
 #define CPP_OS_NETBSD_SPEC "\
 -D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__"
 
+#define LIBGCC_NETBSD_SPEC "-lgcc"
+
 /* OpenBSD support.  */
 #ifndef	LIB_OPENBSD_SPEC
 #define LIB_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
@@ -997,6 +1067,37 @@ ncrtn.o%s"
 #define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
 #endif
 
+#define LIBGCC_OPENBSD_SPEC "-lgcc"
+
+/* Xilinx board support.  */
+
+#define LIB_XILINX_SPEC "                              \
+%{!nostdlib: --start-group -lxil -lc -lm --end-group   \
+%{mppcperflib: %{mfpu=*: -lppcstr405 -lgcc}            \
+%{!mfpu=*: -lppcstr405 -lppcfp -lgcc}}                 \
+%{!mppcperflib: -lgcc}}"
+
+#define CPP_OS_XILINX_SPEC "\
+%{mfpu=sp_lite: -DHAVE_XFPU_SP_LITE}           \
+%{mfpu=sp_full: -DHAVE_XFPU_SP_FULL}           \
+%{mfpu=dp_lite: -DHAVE_XFPU_DP_LITE}           \
+%{mfpu=dp_full: -DHAVE_XFPU_DP_FULL}           \
+%{mfpu=*:   -DHAVE_XFPU}"
+
+#define STARTFILE_XILINX_SPEC "                        \
+ecrti.o%s %{pg: %{!mno-clearbss: xil-pgcrt0.o%s} \
+%{mno-clearbss: xil-sim-pgcrt0.o%s}}            \
+%{!pg: %{!mno-clearbss: xil-crt0.o%s}           \
+%{mno-clearbss: xil-sim-crt0.o%s}} crtbegin.o%s"
+
+#define ENDFILE_XILINX_SPEC "crtend.o%s ecrtn.o%s"
+
+#define LINK_START_XILINX_SPEC "-T xilinx.ld%s"
+
+#define LINK_OS_XILINX_SPEC ""
+
+#define LIBGCC_XILINX_SPEC "-lgcc"
+
 /* Define any extra SPECS that the compiler needs to generate.  */
 /* Override rs6000.h definition.  */
 #undef	SUBTARGET_EXTRA_SPECS
@@ -1011,6 +1112,7 @@ ncrtn.o%s"
   { "lib_linux",		LIB_LINUX_SPEC },			\
   { "lib_netbsd",		LIB_NETBSD_SPEC },			\
   { "lib_openbsd",		LIB_OPENBSD_SPEC },			\
+  { "lib_xilinx",		LIB_XILINX_SPEC },			\
   { "lib_default",		LIB_DEFAULT_SPEC },			\
   { "startfile_ads",		STARTFILE_ADS_SPEC },			\
   { "startfile_yellowknife",	STARTFILE_YELLOWKNIFE_SPEC },		\
@@ -1021,6 +1123,7 @@ ncrtn.o%s"
   { "startfile_linux",		STARTFILE_LINUX_SPEC },			\
   { "startfile_netbsd",		STARTFILE_NETBSD_SPEC },		\
   { "startfile_openbsd",	STARTFILE_OPENBSD_SPEC },		\
+  { "startfile_xilinx",		STARTFILE_XILINX_SPEC },		\
   { "startfile_default",	STARTFILE_DEFAULT_SPEC },		\
   { "endfile_ads",		ENDFILE_ADS_SPEC },			\
   { "endfile_yellowknife",	ENDFILE_YELLOWKNIFE_SPEC },		\
@@ -1031,6 +1134,7 @@ ncrtn.o%s"
   { "endfile_linux",		ENDFILE_LINUX_SPEC },			\
   { "endfile_netbsd",		ENDFILE_NETBSD_SPEC },			\
   { "endfile_openbsd",		ENDFILE_OPENBSD_SPEC },			\
+  { "endfile_xilinx",		ENDFILE_XILINX_SPEC },			\
   { "endfile_default",		ENDFILE_DEFAULT_SPEC },			\
   { "link_path",		LINK_PATH_SPEC },			\
   { "link_shlib",		LINK_SHLIB_SPEC },			\
@@ -1045,6 +1149,7 @@ ncrtn.o%s"
   { "link_start_linux",		LINK_START_LINUX_SPEC },		\
   { "link_start_netbsd",	LINK_START_NETBSD_SPEC },		\
   { "link_start_openbsd",	LINK_START_OPENBSD_SPEC },		\
+  { "link_start_xilinx",	LINK_START_XILINX_SPEC },		\
   { "link_start_default",	LINK_START_DEFAULT_SPEC },		\
   { "link_os",			LINK_OS_SPEC },				\
   { "link_os_ads",		LINK_OS_ADS_SPEC },			\
@@ -1056,6 +1161,7 @@ ncrtn.o%s"
   { "link_os_gnu",		LINK_OS_GNU_SPEC },			\
   { "link_os_netbsd",		LINK_OS_NETBSD_SPEC },			\
   { "link_os_openbsd",		LINK_OS_OPENBSD_SPEC },			\
+  { "link_os_xilinx",		LINK_OS_XILINX_SPEC },			\
   { "link_os_default",		LINK_OS_DEFAULT_SPEC },			\
   { "cc1_endian_big",		CC1_ENDIAN_BIG_SPEC },			\
   { "cc1_endian_little",	CC1_ENDIAN_LITTLE_SPEC },		\
@@ -1070,8 +1176,11 @@ ncrtn.o%s"
   { "cpp_os_linux",		CPP_OS_LINUX_SPEC },			\
   { "cpp_os_netbsd",		CPP_OS_NETBSD_SPEC },			\
   { "cpp_os_openbsd",		CPP_OS_OPENBSD_SPEC },			\
+  { "cpp_os_xilinx",		CPP_OS_XILINX_SPEC },			\
   { "cpp_os_default",		CPP_OS_DEFAULT_SPEC },			\
   { "fbsd_dynamic_linker",	FBSD_DYNAMIC_LINKER },			\
+  { "libgcc_xilinx",		LIBGCC_XILINX_SPEC },			\
+  { "libgcc_default",		LIBGCC_DEFAULT_SPEC },			\
   SUBSUBTARGET_EXTRA_SPECS
 
 #define	SUBSUBTARGET_EXTRA_SPECS
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn gcc-orig/gcc/config/rs6000/sysv4.opt gcc/gcc/config/rs6000/sysv4.opt
--- gcc-orig/gcc/config/rs6000/sysv4.opt	2008-10-22 10:07:45.000000000 -0700
+++ gcc/gcc/config/rs6000/sysv4.opt	2008-10-22 10:09:05.000000000 -0700
@@ -142,3 +142,8 @@ Generate code to use a non-exec PLT and 
 mbss-plt
 Target Report RejectNegative Var(secure_plt, 0)
 Generate code for old exec BSS PLT
+
+mxilinx
+Target RejectNegative
+Build for Xilinx target
+
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn gcc-orig/gcc/config.gcc gcc/gcc/config.gcc
--- gcc-orig/gcc/config.gcc	2008-10-22 10:07:47.000000000 -0700
+++ gcc/gcc/config.gcc	2008-10-22 10:09:05.000000000 -0700
@@ -136,6 +136,8 @@
 #
 #  target_cpu_default	Set to override the default target model.
 #
+#  target_board_default	Set to override the default target board.
+#
 #  gdb_needs_out_file_path
 #			Set to yes if gdb needs a dir command with
 #			`dirname $out_file`.
@@ -183,6 +185,8 @@ xm_defines=
 use_collect2=
 # Set this to override the default target model.
 target_cpu_default=
+# Set this to override the default target board.
+target_board_default=
 # Set this if gdb needs a dir command with `dirname $out_file`
 gdb_needs_out_file_path=
 # Set this to control which thread package will be used.
@@ -3153,3 +3157,15 @@ then
 		target_cpu_default=$target_cpu_default2
 	fi
 fi
+
+if [ "x$with_board" != "x" ]; then 
+	target_board_default=`echo $with_board|tr a-z A-Z`
+        case ${target_board_default} in
+	        YELLOWKNIFE | ADS | MVME | SIM | XILINX )
+                	;;
+          	*)
+                	echo "-with-board=$with_board is not valid"
+                	exit 1
+			;;
+	esac
+fi
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn gcc-orig/gcc/configure gcc/gcc/configure
--- gcc-orig/gcc/configure	2008-10-22 10:07:45.000000000 -0700
+++ gcc/gcc/configure	2008-10-22 10:09:05.000000000 -0700
@@ -458,7 +458,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN OBJDUMP ac_ct_OBJDUMP ac_ct_AR STRIP ac_ct_STRIP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default GMPLIBS GMPINC PPLLIBS PPLINC CLOOGLIBS CLOOGINC LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP loose_warn strict_warn warn_cflags nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_fixed_point enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep PKGVERSION REPORT_BUGS_TO REPORT_BUGS_TEXI datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS BUILD_LDFLAGS STMP_FIXINC STMP_FIXPROTO collect2 LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN OBJDUMP ac_ct_OBJDUMP ac_ct_AR STRIP ac_ct_STRIP lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 objdir enable_fast_install gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir subdirs srcdir all_compilers all_gtfiles all_lang_makefrags all_lang_makefiles all_languages all_selected_languages build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs fortran_target_objs target_cpu_default target_board_default GMPLIBS GMPINC PPLLIBS PPLINC CLOOGLIBS CLOOGINC LIBOBJS LTLIBOBJS'
 ac_subst_files='language_hooks'
 ac_pwd=`pwd`
 
@@ -24718,6 +24718,7 @@ fi;
 
 
 
+
 # Echo link setup.
 if test x${build} = x${host} ; then
   if test x${host} = x${target} ; then
@@ -25590,6 +25591,7 @@ s,@c_target_objs@,$c_target_objs,;t t
 s,@cxx_target_objs@,$cxx_target_objs,;t t
 s,@fortran_target_objs@,$fortran_target_objs,;t t
 s,@target_cpu_default@,$target_cpu_default,;t t
+s,@target_board_default@,$target_board_default,;t t
 s,@GMPLIBS@,$GMPLIBS,;t t
 s,@GMPINC@,$GMPINC,;t t
 s,@PPLLIBS@,$PPLLIBS,;t t
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn gcc-orig/gcc/configure.ac gcc/gcc/configure.ac
--- gcc-orig/gcc/configure.ac	2008-10-22 10:07:41.000000000 -0700
+++ gcc/gcc/configure.ac	2008-10-22 10:09:05.000000000 -0700
@@ -3876,6 +3876,7 @@ AC_SUBST(c_target_objs)
 AC_SUBST(cxx_target_objs)
 AC_SUBST(fortran_target_objs)
 AC_SUBST(target_cpu_default)
+AC_SUBST(target_board_default)
 
 AC_SUBST_FILE(language_hooks)
 
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn gcc-orig/gcc/doc/install.texi gcc/gcc/doc/install.texi
--- gcc-orig/gcc/doc/install.texi	2008-10-22 10:07:44.000000000 -0700
+++ gcc/gcc/doc/install.texi	2008-10-22 10:09:05.000000000 -0700
@@ -1501,6 +1501,11 @@ When you use this option, you should ens
 @command{ranlib} and @command{strip} if necessary, and possibly
 @command{objdump}.  Otherwise, GCC may use an inconsistent set of
 tools.
+
+@item --with-board
+@itemx --with-board=``@var{board}''
+Specifies the default target board.  Equivalent to specifying -m@var{board}
+on the gcc command line. 
 @end table
 
 @subheading Java-Specific Options
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn gcc-orig/gcc/doc/invoke.texi gcc/gcc/doc/invoke.texi
--- gcc-orig/gcc/doc/invoke.texi	2008-10-22 10:07:44.000000000 -0700
+++ gcc/gcc/doc/invoke.texi	2008-10-22 10:09:05.000000000 -0700
@@ -741,7 +741,7 @@ See RS/6000 and PowerPC Options.
 -mdlmzb -mno-dlmzb @gol
 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
 -mprototype  -mno-prototype @gol
--msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
+-msim  -mmvme  -mads  -myellowknife  -mxilinx  memb  -msdata @gol
 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread}
 
 @emph{S/390 and zSeries Options}
@@ -13968,9 +13968,16 @@ On embedded PowerPC systems, assume that
 @item -myellowknife
 @opindex myellowknife
 On embedded PowerPC systems, assume that the startup module is called
-@file{crt0.o} and the standard C libraries are @file{libyk.a} and
+@file{crt0.o} and the standard C libraries are @file{libxil.a} and
 @file{libc.a}.
 
+@item -mxilinx
+@opindex mxilinx
+On embedded PowerPC systems, assume that the startup module is called
+@file{xil-crt0.o} and the standard C libraries are @file{libyk.a} and
+@file{libc.a}.  Also set appropriate options to support Xilinx 
+target boards.
+
 @item -mvxworks
 @opindex mvxworks
 On System V.4 and embedded PowerPC systems, specify that you are
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn gcc-orig/gcc/Makefile.in gcc/gcc/Makefile.in
--- gcc-orig/gcc/Makefile.in	2008-10-22 10:07:41.000000000 -0700
+++ gcc/gcc/Makefile.in	2008-10-22 10:09:05.000000000 -0700
@@ -436,6 +436,7 @@ lang_opt_files=@lang_opt_files@ $(srcdir
 lang_specs_files=@lang_specs_files@
 lang_tree_files=@lang_tree_files@
 target_cpu_default=@target_cpu_default@
+target_board_default=@target_board_default@
 GCC_THREAD_FILE=@thread_file@
 OBJC_BOEHM_GC=@objc_boehm_gc@
 GTHREAD_FLAGS=@gthread_flags@
@@ -1510,6 +1511,7 @@ cs-tconfig.h: Makefile
 
 cs-tm.h: Makefile
 	TARGET_CPU_DEFAULT="$(target_cpu_default)" \
+	TARGET_BOARD_DEFAULT=$(target_board_default) \
 	HEADERS="$(tm_include_list)" DEFINES="$(tm_defines)" \
 	$(SHELL) $(srcdir)/mkconfig.sh tm.h
 
diff -urNp --exclude '*.swp' --exclude DEV-PHASE --exclude .svn gcc-orig/gcc/mkconfig.sh gcc/gcc/mkconfig.sh
--- gcc-orig/gcc/mkconfig.sh	2008-10-22 10:07:45.000000000 -0700
+++ gcc/gcc/mkconfig.sh	2008-10-22 10:09:05.000000000 -0700
@@ -21,11 +21,13 @@
 # Generate gcc's various configuration headers:
 # config.h, tconfig.h, bconfig.h, tm.h, and tm_p.h.
 # $1 is the file to generate.  DEFINES, HEADERS, and possibly
-# TARGET_CPU_DEFAULT are expected to be set in the environment.
+# TARGET_CPU_DEFAULT and TARGET_BOARD_DEFAULT are expected to be 
+# set in the environment.
 
 if [ -z "$1" ]; then
     echo "Usage: DEFINES='list' HEADERS='list' \\" >&2
     echo "  [TARGET_CPU_DEFAULT='default'] mkconfig.sh FILE" >&2
+    echo "  [TARGET_BOARD_DEFAULT='default'] mkconfig.sh FILE" >&2
     exit 1
 fi
 
@@ -54,6 +56,12 @@ if [ "$TARGET_CPU_DEFAULT" != "" ]; then
     echo "#define TARGET_CPU_DEFAULT ($TARGET_CPU_DEFAULT)" >> ${output}T
 fi
 
+# Define TARGET_BOARD_DEFAULT if the system wants one.
+# This substitutes for lots of *.h files.
+if [ "$TARGET_BOARD_DEFAULT" != "" ]; then
+    echo "#define TARGET_BOARD_DEFAULT $TARGET_BOARD_DEFAULT" >> ${output}T
+fi
+
 # Provide defines for other macros set in config.gcc for this file.
 for def in $DEFINES; do
     echo "#ifndef $def" | sed 's/=.*//' >> ${output}T

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc-eabi board support for Xilinx
  2008-10-22 19:38 [PATCH] powerpc-eabi board support for Xilinx Michael Eager
@ 2008-11-04 21:35 ` Michael Meissner
  2008-11-04 21:56   ` Nathan Froyd
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Meissner @ 2008-11-04 21:35 UTC (permalink / raw)
  To: Michael Eager; +Cc: gcc-patches

On Wed, Oct 22, 2008 at 10:58:00AM -0700, Michael Eager wrote:
> I've been somewhat annoyed that when gcc is built with
> --target=powerpc-*-eabi, I need to specify a target board with
> -m<board> each time I run gcc to create an executable.  This
> is not the case with --target=powerpc-eabisim, since this
> configuration uses config/rs6000/eabisim.h to overwrite the
> target options in config/rs6000/sysv4.h to force sim to be
> the default.
> 
> The attached patch does two things:  First, it creates a
> --with-board=<board> option which will set the default
> target board for a build with --target=powerpc-*-eabi.  The
> user can still override this with a -m<board> option.  Second,
> it creates -mxilinx, which specifies target options for
> using various Xilinx PowerPC development boards.
> 
> [It's arguable whether any of this should be in sysv4.h,
> or whether there should be different build configurations
> for the various boards, like is done with powerpc-eabisim.
> But this patch maintains compatibility with past builds.]

I'm not the current maintainer of the powerpc stuff, but I did add the
eabisim back in the day when I was the maintainer.  At that time, it was
prevalent to add different board packages via -m<option>.  The problem is it
can take a long time to perculate these changes and the board companies tend to
move much faster, and eventually you wind up with a bunch of -m<option> options
that nobody uses anymore.  The powerpc-eabisim was added primarily to allow the
testsuites to be run without having real hardware.

I thought most of the ppc board packages had moved away from adding -m<option>,
and instead were using specs files or shell script wrappers to add the
particular libraries that were used.  This way they could use an off the shelf
compiler and not have to add libraries.  I must admit to not really knowing
that part of the market these days.

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc-eabi board support for Xilinx
  2008-11-04 21:35 ` Michael Meissner
@ 2008-11-04 21:56   ` Nathan Froyd
  2008-11-05 17:13     ` Michael Eager
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Froyd @ 2008-11-04 21:56 UTC (permalink / raw)
  To: Michael Meissner, Michael Eager, gcc-patches

On Tue, Nov 04, 2008 at 04:34:53PM -0500, Michael Meissner wrote:
> On Wed, Oct 22, 2008 at 10:58:00AM -0700, Michael Eager wrote:
> > The attached patch does two things:  First, it creates a
> > --with-board=<board> option which will set the default
> > target board for a build with --target=powerpc-*-eabi.  The
> > user can still override this with a -m<board> option.  Second,
> > it creates -mxilinx, which specifies target options for
> > using various Xilinx PowerPC development boards.
> 
> I thought most of the ppc board packages had moved away from adding -m<option>,
> and instead were using specs files or shell script wrappers to add the
> particular libraries that were used.  This way they could use an off the shelf
> compiler and not have to add libraries.  I must admit to not really knowing
> that part of the market these days.

For what it's worth, we use linker scripts (specified by the user, but
by-and-large provided by us; the user is welcome to create
board-specific linker scripts, of course) to handle most of the bits
that the -m<board> options currently handle.  (Libraries and linker
scripts bits seem to be all that -m<board> is used for anyway, and
linker scripts can fill in for both.)

-Nathan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc-eabi board support for Xilinx
  2008-11-04 21:56   ` Nathan Froyd
@ 2008-11-05 17:13     ` Michael Eager
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Eager @ 2008-11-05 17:13 UTC (permalink / raw)
  To: Michael Meissner, Michael Eager, gcc-patches

Nathan Froyd wrote:
> On Tue, Nov 04, 2008 at 04:34:53PM -0500, Michael Meissner wrote:
>> On Wed, Oct 22, 2008 at 10:58:00AM -0700, Michael Eager wrote:
>>> The attached patch does two things:  First, it creates a
>>> --with-board=<board> option which will set the default
>>> target board for a build with --target=powerpc-*-eabi.  The
>>> user can still override this with a -m<board> option.  Second,
>>> it creates -mxilinx, which specifies target options for
>>> using various Xilinx PowerPC development boards.
>> I thought most of the ppc board packages had moved away from adding -m<option>,
>> and instead were using specs files or shell script wrappers to add the
>> particular libraries that were used.  This way they could use an off the shelf
>> compiler and not have to add libraries.  I must admit to not really knowing
>> that part of the market these days.
> 
> For what it's worth, we use linker scripts (specified by the user, but
> by-and-large provided by us; the user is welcome to create
> board-specific linker scripts, of course) to handle most of the bits
> that the -m<board> options currently handle.  (Libraries and linker
> scripts bits seem to be all that -m<board> is used for anyway, and
> linker scripts can fill in for both.)

Linker scripts partially address the user's needs, but not completely.
Like specifying -m<board>, they require that the user specify this
on every gcc invocation that generates an executable.

I will resubmit the patch and remove the --with-board configure
option and move the default into a target-specific header file
similar to what is done for --target=powerpc-eabisim.


-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-05 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-22 19:38 [PATCH] powerpc-eabi board support for Xilinx Michael Eager
2008-11-04 21:35 ` Michael Meissner
2008-11-04 21:56   ` Nathan Froyd
2008-11-05 17:13     ` Michael Eager

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).