This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: x86-linux -> x86-pc cross


>-----Original Message-----
>From: Stephen Smith [mailto:ischis2@home.com]
>Sent: 14 June 2001 16:55

>>   You may want to change that --enable-threads option, presumably since
>> you're compiling for a naked board with no OS you'd want to use
>> --disable-threads.  You should probably also replace --enable-shared with
>> --disable-shared since you probably don't have a dynamic linker on your
>> target for loading libgcc.a at runtime....
>>
>
>Only one problem:  my embedded system does support threads and 
>exception handling.

  Ah, ok.  In that case you'll probably have to implement your own thread
support for gcc.  If your OS has fully POSIX compliant threads, you just
need to specify --enable-threads=posix.  Otherwise, look at gcc/gthr.h to
see the set of functions that you have to map onto the functionality that 
you do have available.  Looking at this bit of configure.in (line #1529
in 2.95.3)

--8<--snip--8<--
changequote(,)dnl
	i[34567]86-*-pe | i[34567]86-*-cygwin*)
changequote([,])dnl
		xm_file="${xm_file} i386/xm-cygwin.h"
		tmake_file=i386/t-cygwin
		tm_file=i386/cygwin.h
		xmake_file=i386/x-cygwin
		extra_objs=winnt.o
 		if test x$enable_threads = xyes; then
			thread_file='win32'
		fi
		exeext=.exe
		;;
-->8--snip-->8--

you can see that the i?86-pc-pe target is assumed to be the same thing as
the i?86-pc-cygwin target, and to have win32 threads available.  You might
want to separate this out into two parts, with a new value for thread_file
in the i?86-*-pe section:

--8<--snip--8<--
changequote(,)dnl
	i[34567]86-*-cygwin*)
changequote([,])dnl
		xm_file="${xm_file} i386/xm-cygwin.h"
		tmake_file=i386/t-cygwin
		tm_file=i386/cygwin.h
		xmake_file=i386/x-cygwin
		extra_objs=winnt.o
 		if test x$enable_threads = xyes; then
			thread_file='win32'
		fi
		exeext=.exe
		;;
changequote(,)dnl
	i[34567]86-*-pe)
changequote([,])dnl
		xm_file="${xm_file} i386/xm-cygwin.h"
		tmake_file=i386/t-cygwin
		tm_file=i386/cygwin.h
		xmake_file=i386/x-cygwin
		extra_objs=winnt.o
 		if test x$enable_threads = xyes; then
			thread_file='custom'
		fi
		exeext=.exe
		;;
-->8--snip-->8--

and then all you'd need to do should be to add a file called gthr-custom.h
into the gcc source directory, which provides the same functions as all
the other gthr- files.  Hopefully that would work nicely.

>  BTW, the motorola-powerpc-elf target works just fine.

  Yes, and?  Windows doesn't exist for ppc, which is probably why that 
particular target doesn't run into the same error.  Windows does exist for
x86, and someone at some stage has made the invalid assumption that any
x86-pc-pe system has to be running windows, and therefore it would be safe
to include windows.h without checking for it first; that's why the build
goes wrong.

>  Do you have any other suggestions.

  The bit about --disable-shared still applies, unless you also have runtime
dynamic loading/linking support.

>  Should I use the windows support package that comes with cygwin.

  Not unless you're running windows AND cygwin on your embedded PC!  AFAIUI,
that winsup stuff is support functions for cygwin that call out to the win32
api in order to provide services that cygwin needs to run.  It really won't
help any!  No, I think all you should need to do is tell gcc how to use the
threads functionality of your target as described above.

  Do you have an embedded OS, or are you running newlib or some bare-bones
BSP?

       DaveK
-- 
we are not seats or eyeballs or end users or consumers.
we are human beings - and our reach exceeds your grasp.
                    deal with it.                      - cluetrain.org 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]