public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Compiling a cross compiler for VXWorks - "cannot compute suffix of object files"
@ 2011-02-02  4:03 Thomas Clark
  2011-02-02 10:23 ` Kai Ruottu
  2011-02-02 14:14 ` Ian Lance Taylor
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Clark @ 2011-02-02  4:03 UTC (permalink / raw)
  To: gcc-help

I'm trying to compile GCC (right from the svn trunk) on an i686-pc-linux-gnu
host, targeting powerpc-wrs-vxworks.  I'm using gcc 4.6.0 to compile it.  I
configured it like so:

  ~/gcc/trunk/configure --target=powerpc-wrs-vxworks --host=i686-linux-gnu \
    --enable-languages=c++

The error was:

  checking for suffix of object files... configure: error: in
  `~/gcc/trunk/powerpc-wrs-
vxworks/libgcc': configure: error: cannot compute
  suffix of object files: cannot compiled
  See `config.log' for more details.

This particular snippet of config.log seemed like the problem.  If necessary, I
will upload the full file.

  /usr/bin/uname -p = unknown
  /bin/uname -X     = unknown

  /bin/arch              = unknown
  /usr/bin/arch -k       = unknown
  /usr/convex/getsysinfo = unknown
  /usr/bin/hostinfo      = unknown
  /bin/machine           = unknown
  /usr/bin/oslevel       = unknown
  /bin/universe          = unknown

Does anyone know what I can do to fix this and get GCC to build?

Sorry if this has been brought up before - I did my best to search, but I'm
having a hard time finding out what the problem is.

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

* Re: Compiling a cross compiler for VXWorks - "cannot compute suffix of object files"
  2011-02-02  4:03 Compiling a cross compiler for VXWorks - "cannot compute suffix of object files" Thomas Clark
@ 2011-02-02 10:23 ` Kai Ruottu
  2011-02-02 13:40   ` Kai Ruottu
  2011-02-02 14:14 ` Ian Lance Taylor
  1 sibling, 1 reply; 6+ messages in thread
From: Kai Ruottu @ 2011-02-02 10:23 UTC (permalink / raw)
  To: gcc-help

2.2.2011 6:03, Thomas Clark kirjoitti:

> I'm trying to compile GCC (right from the svn trunk) on an i686-pc-linux-gnu
> host, targeting powerpc-wrs-vxworks.  I'm using gcc 4.6.0 to compile it.  I
> configured it like so:
>
>    ~/gcc/trunk/configure --target=powerpc-wrs-vxworks --host=i686-linux-gnu \
>      --enable-languages=c++
>
> The error was:
>
>    checking for suffix of object files... configure: error: in
>    `~/gcc/trunk/powerpc-wrs-vxworks/libgcc':
>    configure: error: cannot compute  suffix of object files:

What else you did than started to build GCC?  There are prerequisities
like :

1. the target binutils being built and installed

2. the target C library being copied and installed

So GNU binutils made for 'powerpc-wrs-vxworks' and the original target
headers and libraries for 'powerpc-wrs-vxworks' should already be there
before starting to build GCC !  If these prerequisites are OK and then
the build fails, one needs help... Without mentioning these, the case
can be that one or even both were forgotten or not even being known :(

The "Prerequisites" in 'http://gcc.gnu.org/install/prerequisites.html'
is very "one-eyed", talking only about prerequisites for a native GCC
build! As if the target C libray would "automatically" be there (in
'/usr/include' and '/usr/lib') when beginning!

The Windriver VxWorks opys used to be weird because the "apps" weren't
really "executables", only "objects" being linked at runtime, so
expecting to not get any undefined symbols during a link was vain. But
the GCC build system should be aware of this weirdness and succeed in
producing the toolchain, including target libgcc, libstdc++ etc.

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

* Re: Compiling a cross compiler for VXWorks - "cannot compute suffix of object files"
  2011-02-02 10:23 ` Kai Ruottu
@ 2011-02-02 13:40   ` Kai Ruottu
  0 siblings, 0 replies; 6+ messages in thread
From: Kai Ruottu @ 2011-02-02 13:40 UTC (permalink / raw)
  To: gcc-help

2.2.2011 12:23, Kai Ruottu kirjoitti:

> 2.2.2011 6:03, Thomas Clark kirjoitti:
>
>> I'm trying to compile GCC (right from the svn trunk) on an
>> i686-pc-linux-gnu
>> host, targeting powerpc-wrs-vxworks. I'm using gcc 4.6.0 to compile it. I
>> configured it like so:
>>
>> ~/gcc/trunk/configure --target=powerpc-wrs-vxworks
>> --host=i686-linux-gnu \
>> --enable-languages=c++
>>
>> The error was:
>>
>> checking for suffix of object files... configure: error: in
>> `~/gcc/trunk/powerpc-wrs-vxworks/libgcc':
>> configure: error: cannot compute suffix of object files:
>
> What else you did than started to build GCC? There are prerequisities
> like :
>
> 1. the target binutils being built and installed
>
> 2. the target C library being copied and installed

I myself had only some very old vxWorks/PPC headers from 1994, no
startups or libs...

Trying with them stopped with (by '$target/libgcc/config.log) :

------------------ clip --------------------------------
configure:3268: /home/src/gcc-4.6/build/./gcc/xgcc
  -B/home/src/gcc-4.6/build/./gcc/ -B/usr/local/ppc-wrs-vxworks/bin/
  -B/usr/local/ppc-wrs-vxworks/lib/
  -isystem /usr/local/ppc-wrs-vxworks/include
  -isystem /usr/local/ppc-wrs-vxworks/sys-include
  -c -g -Os  conftest.c >&5
xgcc: fatal error: environment variable 'WIND_BASE' not defined
compilation terminated.
------------------ clip --------------------------------

Investigation of this revealed things like the following
in 'gcc/config/vxworks.h' :

------------------ clip --------------------------------
/* We look for the VxWorks header files using the environment
    variables that are set in VxWorks to indicate the location of the
    system header files.  We use -idirafter so that the GCC's own
    header-file directories (containing <stddef.h>, etc.) come before
    the VxWorks system header directories.  */

/* Since we provide a default -isystem, expand -isystem on the command
    line early.  */
#undef VXWORKS_ADDITIONAL_CPP_SPEC
#define VXWORKS_ADDITIONAL_CPP_SPEC             \
  "%{!nostdinc:                                  \
     %{isystem*} -idirafter                      \
     %{mrtp: %:getenv(WIND_USR /h)               \
       ;:    %:getenv(WIND_BASE /target/h)}}"
------------------ clip --------------------------------

So before one starts to build a GCC for vxWorks, one prerequisite
more is to be familiar with the existing WindRiver-provided vxWorks
tools and know where they are keeping the headers, not in 'include'
but in 'target/h' and so on ...

I made a couple of environment settings and symlinks to get the
'include' where those target headers were to be seen in 'h' and
'target/h' there. Then the libgcc build continued until :

------------------ clip --------------------------------
/home/src/gcc-4.6/build/./gcc/xgcc -B/home/src/gcc-4.6/build/./gcc/ 
-B/usr/local/ppc-wrs-vxworks/bin/ -B/usr/local/ppc-wrs-vxworks/lib/ 
-isystem /usr/local/ppc-wrs-vxworks/include -isystem 
/usr/local/ppc-wrs-vxworks/sys-include    -g -Os -mrtp -O2 -nostdinc -I 
`case "/mrtp" in */mrtp*) echo /h ;; *) echo /target/h ;; esac` -g -Os 
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings 
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition  -isystem ./include    -DHAVE_GTHR_DEFAULT 
-DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -fno-stack-protector 
-Dinhibit_libc  -I. -I. -I../../.././gcc -I../../../../libgcc 
-I../../../../libgcc/. -I../../../../libgcc/../gcc 
-I../../../../libgcc/../include  -DHAVE_CC_TLS  -o vxlib.o -MT vxlib.o 
-MD -MP -MF vxlib.dep -fexceptions -c 
../../../../libgcc/../gcc/config/vxlib.c
In file included from /usr/local/ppc-wrs-vxworks/include/vxWorks.h:158:0,
                  from /usr/local/ppc-wrs-vxworks/include/semLib.h:40,
                  from ../../../../libgcc/../gcc/gthr-vxworks.h:51,
                  from ../../.././gcc/gthr-default.h:1,
                  from ../../../../libgcc/../gcc/gthr.h:162,
                  from ../../../../libgcc/../gcc/config/vxlib.c:30:
/usr/local/ppc-wrs-vxworks/include/types/vxTypes.h:66:1: error: 
conflicting types for 'ptrdiff_t'
/home/src/gcc-4.6/build/./gcc/include/stddef.h:150:26: note: previous 
declaration of 'ptrdiff_t' was here
/usr/local/ppc-wrs-vxworks/include/types/vxTypes.h:76:1: error: 
conflicting types for 'wchar_t'
/home/src/gcc-4.6/build/./gcc/include/stddef.h:324:24: note: previous 
declaration of 'wchar_t' was here
../../../../libgcc/../gcc/config/vxlib.c:37:21: fatal error: taskLib.h: 
No such file or directory
compilation terminated.
make[4]: *** [vxlib.o] Virhe 1
make[4]: Poistutaan hakemistosta 
"/home/src/gcc-4.6-20110129/build/ppc-wrs-vxworks/mrtp/libgcc"
------------------ clip --------------------------------

I hadn't that 'taskLib.h' anywhere...

No paying - no working with something one will never need... That was
my result with this :(

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

* Re: Compiling a cross compiler for VXWorks - "cannot compute suffix of object files"
  2011-02-02  4:03 Compiling a cross compiler for VXWorks - "cannot compute suffix of object files" Thomas Clark
  2011-02-02 10:23 ` Kai Ruottu
@ 2011-02-02 14:14 ` Ian Lance Taylor
  2011-02-04  1:37   ` Thomas Clark
  1 sibling, 1 reply; 6+ messages in thread
From: Ian Lance Taylor @ 2011-02-02 14:14 UTC (permalink / raw)
  To: Thomas Clark; +Cc: gcc-help

Thomas Clark <thechewanater@gmail.com> writes:

>   checking for suffix of object files... configure: error: in
>   `~/gcc/trunk/powerpc-wrs-
> vxworks/libgcc': configure: error: cannot compute
>   suffix of object files: cannot compiled
>   See `config.log' for more details.

http://gcc.gnu.org/wiki/FAQ#Configuration_fails_with_.27.27configure:_error:_cannot_compute_suffix_of_object_files:_cannot_compile.27.27._What_is_the_problem.3F

Ian

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

* Re: Compiling a cross compiler for VXWorks - "cannot compute suffix of object files"
  2011-02-02 14:14 ` Ian Lance Taylor
@ 2011-02-04  1:37   ` Thomas Clark
  2011-02-04 11:05     ` Kai Ruottu
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Clark @ 2011-02-04  1:37 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

I'm trying to compile glibc for vxworks, but I'm getting errors with that.

$ ../configure --host=i686-linux-gnu --prefix=/usr/local/ppc-vxworks
$ make

#snip

../sysdeps/i386/fpu/s_frexp.S: Assembler messages:
../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: Missing symbol name in directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `.'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `'
in .size directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after
expression
$

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

* Re: Compiling a cross compiler for VXWorks - "cannot compute suffix of object files"
  2011-02-04  1:37   ` Thomas Clark
@ 2011-02-04 11:05     ` Kai Ruottu
  0 siblings, 0 replies; 6+ messages in thread
From: Kai Ruottu @ 2011-02-04 11:05 UTC (permalink / raw)
  To: gcc-help

4.2.2011 3:37, Thomas Clark kirjoitti:

> I'm trying to compile glibc for vxworks, but I'm getting errors with that.

Why on earth? Does glibc even support vxworks? Nowadays it should be
ported only for Linux.

> $ ../configure --host=i686-linux-gnu --prefix=/usr/local/ppc-vxworks

This would try to produce glibc for Linux/x86 host and target, there
is no difference between host and target in this because the target C
library for some $target/$host is the same everywhere, whether it is
installed on its native platform or on some cross host!

The vxWorks target C library is the one which Wind River Systems will
provide and it cannot be substituted by glibc! If that was your
purpose...

vxWorks has its own startfile, a superset of libgcc.a etc., from the
'gcc/config/vxworks.h' :

/* For VxWorks, the system provides libc_internal.a.  This is a superset
    of libgcc.a; we want to use it.  Make sure not to dynamically export
    any of its symbols, though.  Always look for libgcc.a first so that
    we get the latest versions of the GNU intrinsics during our builds.  */
#undef VXWORKS_LIBGCC_SPEC
#define VXWORKS_LIBGCC_SPEC \
   "-lgcc %{mrtp:--exclude-libs=libc_internal,libgcc -lc_internal}"

#undef VXWORKS_STARTFILE_SPEC
#define VXWORKS_STARTFILE_SPEC "%{mrtp:%{!shared:-l:crt0.o}}"
#define VXWORKS_ENDFILE_SPEC ""

> $ make
>
> #snip
>
> ./sysdeps/i386/fpu/s_frexp.S: Assembler messages:
> ./sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"
> ./sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first
> unrecognized character is `1'

Probably the 'as' being found was for PPC, not for x86 ... For instance
if you put '/usr/local/ppc-vxworks/bin' to be in PATH before '/usr/bin'!

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

end of thread, other threads:[~2011-02-04 10:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02  4:03 Compiling a cross compiler for VXWorks - "cannot compute suffix of object files" Thomas Clark
2011-02-02 10:23 ` Kai Ruottu
2011-02-02 13:40   ` Kai Ruottu
2011-02-02 14:14 ` Ian Lance Taylor
2011-02-04  1:37   ` Thomas Clark
2011-02-04 11:05     ` Kai Ruottu

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).