| Author |
Message |
Jedi
Guest
|
Posted:
Sun Dec 26, 2004 6:20 pm Post subject:
tricore gcc/binutils |
|
|
Someone has the same problem that TriCore gcc doesn't pick up the right
assembler? Always uses native host assenbler "as" instead of "tricore-as".
rick |
|
| Back to top |
|
 |
Jean Tabel
Guest
|
Posted:
Sun Dec 26, 2004 8:26 pm Post subject:
Re: tricore gcc/binutils |
|
|
You can either:
- use the gcc GCC_EXEC_PREFIX environment variable for forcing your gcc
to use tricore-as
instead of as:
export GCC_EXEC_PREFIX=tricore-
See
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Environment-Variables.html#Environment-Variables
- make sure you have a "triccore-as" executable named "as" when you are
cross-compiling (or a symbolic link to it), and add the path the this
"as" in your
PATH environment variable, so that your compiler will find it before
your
native "as":
export PATH=/opt/tricore/bin:$PATH
Hope this help,
Jean Tabel
"Jedi" <me@aol.com> wrote in message
news:cUyzd.282$7%1.24@read3.inet.fi...
| Quote: | Someone has the same problem that TriCore gcc doesn't pick up the
right
assembler? Always uses native host assenbler "as" instead of
"tricore-as".
rick |
|
|
| Back to top |
|
 |
Jedi
Guest
|
Posted:
Mon Dec 27, 2004 4:52 pm Post subject:
Re: tricore gcc/binutils |
|
|
Jean Tabel wrote:
| Quote: | You can either:
- use the gcc GCC_EXEC_PREFIX environment variable for forcing your gcc
to use tricore-as
instead of as:
export GCC_EXEC_PREFIX=tricore-
See
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Environment-Variables.html#Environment-Variables
- make sure you have a "triccore-as" executable named "as" when you are
cross-compiling (or a symbolic link to it), and add the path the this
"as" in your
PATH environment variable, so that your compiler will find it before
your
native "as":
export PATH=/opt/tricore/bin:$PATH
Hope this help,
Jean Tabel
"Jedi" <me@aol.com> wrote in message
news:cUyzd.282$7%1.24@read3.inet.fi...
Someone has the same problem that TriCore gcc doesn't pick up the
right
assembler? Always uses native host assenbler "as" instead of
"tricore-as".
|
I thought about that as well...but it will fail on packages requiring
host and target gcc/as/ld at the same time...
In which file in gcc the EXEC-PREFIX gets stored along with the
pathnames for "gcc", "as" and "ld" ?
rick |
|
| Back to top |
|
 |
Jean Tabel
Guest
|
Posted:
Mon Dec 27, 2004 8:15 pm Post subject:
Re: tricore gcc/binutils |
|
|
"Jedi" <me@aol.com> wrote in message
news:aISzd.373$ya3.143@read3.inet.fi...
| Quote: | Jean Tabel wrote:
You can either:
- use the gcc GCC_EXEC_PREFIX environment variable for forcing your
gcc
to use tricore-as
instead of as:
export GCC_EXEC_PREFIX=tricore-
snip
I thought about that as well...but it will fail on packages requiring
host and target gcc/as/ld at the same time...
In which file in gcc the EXEC-PREFIX gets stored along with the
pathnames for "gcc", "as" and "ld" ?
I don't know about any configuration files containing the prefix. |
The tricore toolchain should have been compiled using the option
--target=tricore, so that exact names for the various executables
could have been hardcoded in the executables themselves.
Best solution in your case may be just to go through the various
makefiles of your packages, and to modify the values for CC
make variables.
This can be done automatically without modifying the Makefiles
if your packages are using "configure" scripts.
In this case, just replace
../configure
by
CC=/opt/tricore/bin/gcc ./configure
Could you give me more information on the packages using both
tricore and native gcc you want to build ? This may help me to
help you...
Jean Tabel
> rick |
|
| Back to top |
|
 |
Jedi
Guest
|
Posted:
Tue Dec 28, 2004 12:04 am Post subject:
Re: tricore gcc/binutils |
|
|
Jean Tabel wrote:
| Quote: | "Jedi" <me@aol.com> wrote in message
news:aISzd.373$ya3.143@read3.inet.fi...
Jean Tabel wrote:
You can either:
- use the gcc GCC_EXEC_PREFIX environment variable for forcing your
gcc
to use tricore-as
instead of as:
export GCC_EXEC_PREFIX=tricore-
snip
I thought about that as well...but it will fail on packages requiring
host and target gcc/as/ld at the same time...
In which file in gcc the EXEC-PREFIX gets stored along with the
pathnames for "gcc", "as" and "ld" ?
I don't know about any configuration files containing the prefix.
The tricore toolchain should have been compiled using the option
--target=tricore, so that exact names for the various executables
could have been hardcoded in the executables themselves.
Best solution in your case may be just to go through the various
makefiles of your packages, and to modify the values for CC
make variables.
This can be done automatically without modifying the Makefiles
if your packages are using "configure" scripts.
In this case, just replace
./configure
by
CC=/opt/tricore/bin/gcc ./configure
Could you give me more information on the packages using both
tricore and native gcc you want to build ? This may help me to
help you...
Jean Tabel
rick
|
Hello (o;
THe tricore toolchain was configured with "target=tricore-elf"...though
the company who has done that called "High-Tec" in Germany has f**ked up
it badly (o; There are other errors during compile time like not finding
libiconv even if you specifiy it when configuring...
Anyway (o;
Certain packages which require are for example uClinux and u-boot
which use host compiler in the beginning (for tkconfig as an example).
Does gcc has a switch to show the compiled in EXEC-PREFIX?
Or any other useful information?
best regards
rick |
|
| Back to top |
|
 |
Tauno Voipio
Guest
|
Posted:
Tue Dec 28, 2004 1:11 am Post subject:
Re: tricore gcc/binutils |
|
|
Jedi wrote:
| Quote: | Jean Tabel wrote:
"Jedi" <me@aol.com> wrote in message
news:aISzd.373$ya3.143@read3.inet.fi...
Jean Tabel wrote:
You can either:
- use the gcc GCC_EXEC_PREFIX environment variable for forcing your
gcc
to use tricore-as
instead of as:
export GCC_EXEC_PREFIX=tricore-
snip
I thought about that as well...but it will fail on packages requiring
host and target gcc/as/ld at the same time...
In which file in gcc the EXEC-PREFIX gets stored along with the
pathnames for "gcc", "as" and "ld" ?
I don't know about any configuration files containing the prefix.
The tricore toolchain should have been compiled using the option
--target=tricore, so that exact names for the various executables
could have been hardcoded in the executables themselves.
Best solution in your case may be just to go through the various
makefiles of your packages, and to modify the values for CC
make variables.
This can be done automatically without modifying the Makefiles
if your packages are using "configure" scripts.
In this case, just replace
./configure
by
CC=/opt/tricore/bin/gcc ./configure
Could you give me more information on the packages using both
tricore and native gcc you want to build ? This may help me to
help you...
Jean Tabel
rick
Hello (o;
THe tricore toolchain was configured with "target=tricore-elf"...though
the company who has done that called "High-Tec" in Germany has f**ked up
it badly (o; There are other errors during compile time like not finding
libiconv even if you specifiy it when configuring...
Anyway (o;
Certain packages which require are for example uClinux and u-boot
which use host compiler in the beginning (for tkconfig as an example).
Does gcc has a switch to show the compiled in EXEC-PREFIX?
Or any other useful information?
|
Try
the-prefix-gcc -dumpspecs
substituting the proper prefix for the-prefix (e.g. arm-elf-gcc).
It dumps the configuration specifications in GCC internal
format which is not too easy to read but it contains
the specifications.
HTH
--
Tauno Voipio
tauno voipio (at) iki fi
PS. How about building it yourself?
There are good instructions in the net, google for 'cross-gcc'.
TV |
|
| Back to top |
|
 |
Jedi
Guest
|
Posted:
Tue Dec 28, 2004 3:29 am Post subject:
Re: tricore gcc/binutils |
|
|
| Quote: |
Try
the-prefix-gcc -dumpspecs
substituting the proper prefix for the-prefix (e.g. arm-elf-gcc).
It dumps the configuration specifications in GCC internal
format which is not too easy to read but it contains
the specifications.
HTH
|
Looks better now...
I made links from individual "/usr/local/tricore/bin/tricore-xxx" to
"/usr/local/tricore/bin/xxx"...
So only complaining now about missing libc (o;
iMac:~/develop/tricore jedi$ tricore-gcc main.c
/usr/local/tricore/lib/gcc-lib/tricore//../../../../tricore/bin/ld:
cannot find -lc
rick |
|
| Back to top |
|
 |
Jean Tabel
Guest
|
Posted:
Tue Dec 28, 2004 5:54 am Post subject:
Re: tricore gcc/binutils |
|
|
You may try to specify the path for libc by using the -L option:
tricore-gcc -L/usr/local/tricore/lib -o main main.c
Jean Tabel
"Jedi" <me@aol.com> wrote in message
news:f10Ad.679$ya3.169@read3.inet.fi...
| Quote: |
Try
the-prefix-gcc -dumpspecs
substituting the proper prefix for the-prefix (e.g. arm-elf-gcc).
It dumps the configuration specifications in GCC internal
format which is not too easy to read but it contains
the specifications.
HTH
Looks better now...
I made links from individual "/usr/local/tricore/bin/tricore-xxx" to
"/usr/local/tricore/bin/xxx"...
So only complaining now about missing libc (o;
iMac:~/develop/tricore jedi$ tricore-gcc main.c
/usr/local/tricore/lib/gcc-lib/tricore//../../../../tricore/bin/ld:
cannot find -lc
rick
|
|
|
| Back to top |
|
 |
Jedi
Guest
|
Posted:
Tue Dec 28, 2004 4:25 pm Post subject:
Re: tricore gcc/binutils |
|
|
Jean Tabel wrote:
| Quote: | You may try to specify the path for libc by using the -L option:
tricore-gcc -L/usr/local/tricore/lib -o main main.c
|
I know that one...have to compile glibc first for tricore...
but there I'm stuck again with this crippled tricore port:
.../sysdeps/tricore/dl-machine.h: In function `elf_machine_load_address':
.../sysdeps/tricore/dl-machine.h:57: error: [11705] parse error before "movh"
.../sysdeps/tricore/dl-machine.h:57:28: invalid suffix "b" on integer
constant
.../sysdeps/tricore/dl-machine.h:58:28: invalid suffix "b" on integer
constant
.../sysdeps/tricore/dl-machine.h:59:36: invalid suffix "b" on integer
constant
.../sysdeps/tricore/dl-machine.h:60:36: invalid suffix "b" on integer
constant
.../sysdeps/tricore/dl-machine.h:62:29: missing terminating " character
Anything wrong with the inline assembly code in it?
/* Return the run-time load address of the shared object. */
static inline Elf32_Addr __attribute__ ((unused))
elf_machine_load_address (void)
{
void *tmp, *address;
asm("0:
movh.a %0, hi:0b
lea %0, [%0]lo:0b
addih.a %1, %%a12,gotoffhi:0b
lea %1, [%1] gotofflo:0b
sub.a %0, %1, %0
" : "=a"(address), "=a"(tmp));
return (Elf32_Addr)address;
} /* ok: 2003.7.2 */
Never used any inline asm stuff in gcc before (o;
best regards
rick |
|
| Back to top |
|
 |
Jean Tabel
Guest
|
Posted:
Tue Dec 28, 2004 11:08 pm Post subject:
Re: tricore gcc/binutils |
|
|
I downloaded the tricore toolchain, and got the same error message
when attempting to compile your code after having included
ELFTypes.h in oder to get a definition for Elf32_Addr.
It seems the reason is that new versions of gcc don't support multi-line
string
literals anymore - you should use string concatenation instead:
see http://www.uclibc.org/lists/uclibc/2004-March/008545.html
and the answer http://www.uclibc.org/lists/uclibc/2004-March/008554.html
The following code compiled properly:
#include <ELFTypes.h>
static inline Elf32_Addr __attribute__ ((unused))
elf_machine_load_address (void)
{
void *tmp, *address;
asm("0:"
"movh.a %0, hi:0b"
"lea %0, [%0]lo:0b"
"addih.a %1, %%a12,gotoffhi:0b"
"lea %1, [%1] gotofflo:0b"
"sub.a %0, %1, %0"
: "=a"(address), "=a"(tmp));
return (Elf32_Addr)address;
} /* ok: 2003.7.2 */
I don't know of an option that may force the new preprocessor to behave
the same way the old did, but you should investigate further.
An other obvious solution would be to look for a version of the kernel
or glibc which is
not using this deprecated construct.
Hope this help,
Jean Tabel
<snip>
| Quote: | Anything wrong with the inline assembly code in it?
/* Return the run-time load address of the shared object. */
static inline Elf32_Addr __attribute__ ((unused))
elf_machine_load_address (void)
{
void *tmp, *address;
asm("0:
movh.a %0, hi:0b
lea %0, [%0]lo:0b
addih.a %1, %%a12,gotoffhi:0b
lea %1, [%1] gotofflo:0b
sub.a %0, %1, %0
" : "=a"(address), "=a"(tmp));
return (Elf32_Addr)address;
} /* ok: 2003.7.2 */
Never used any inline asm stuff in gcc before (o;
best regards
rick
|
|
|
| Back to top |
|
 |
Jedi
Guest
|
Posted:
Wed Dec 29, 2004 1:45 pm Post subject:
Re: tricore gcc/binutils |
|
|
Jean Tabel wrote:
| Quote: | I downloaded the tricore toolchain, and got the same error message
when attempting to compile your code after having included
ELFTypes.h in oder to get a definition for Elf32_Addr.
|
Hmm..where did you download the toolchain?
Was only able to find a patch against GNU sources..
rick |
|
| Back to top |
|
 |
Jedi
Guest
|
Posted:
Wed Dec 29, 2004 2:22 pm Post subject:
Re: tricore gcc/binutils |
|
|
Jean Tabel wrote:
| Quote: | I downloaded the tricore toolchain, and got the same error message
when attempting to compile your code after having included
ELFTypes.h in oder to get a definition for Elf32_Addr.
It seems the reason is that new versions of gcc don't support multi-line
string
literals anymore - you should use string concatenation instead:
see http://www.uclibc.org/lists/uclibc/2004-March/008545.html
and the answer http://www.uclibc.org/lists/uclibc/2004-March/008554.html
The following code compiled properly:
#include <ELFTypes.h
static inline Elf32_Addr __attribute__ ((unused))
elf_machine_load_address (void)
{
void *tmp, *address;
asm("0:"
"movh.a %0, hi:0b"
"lea %0, [%0]lo:0b"
"addih.a %1, %%a12,gotoffhi:0b"
"lea %1, [%1] gotofflo:0b"
"sub.a %0, %1, %0"
: "=a"(address), "=a"(tmp));
return (Elf32_Addr)address;
} /* ok: 2003.7.2 */
I don't know of an option that may force the new preprocessor to behave
the same way the old did, but you should investigate further.
An other obvious solution would be to look for a version of the kernel
or glibc which is
not using this deprecated construct.
|
Thanx (o;
Best way is add a '\n\' at the end of every assembly line..
that fixes it...
Now where is the missing "crtbegin.o" and "crtend.o"...
seems it is missing in the toolchain..only crt0.o there...
rick |
|
| Back to top |
|
 |
Jean Tabel
Guest
|
Posted:
Wed Dec 29, 2004 8:16 pm Post subject:
Re: tricore gcc/binutils |
|
|
"Jedi" <me@aol.com> wrote in message
news:v8uAd.57$vy5.49@read3.inet.fi...
| Quote: | Jean Tabel wrote:
I downloaded the tricore toolchain, and got the same error message
when attempting to compile your code after having included
ELFTypes.h in oder to get a definition for Elf32_Addr.
Hmm..where did you download the toolchain?
http://www.hightec-rt.com/downloads/tricore.exe |
| Quote: | Was only able to find a patch against GNU sources..
rick |
|
|
| Back to top |
|
 |
Jedi
Guest
|
Posted:
Thu Dec 30, 2004 1:08 am Post subject:
Re: tricore gcc/binutils |
|
|
Jean Tabel wrote:
| Quote: | "Jedi" <me@aol.com> wrote in message
news:v8uAd.57$vy5.49@read3.inet.fi...
Jean Tabel wrote:
I downloaded the tricore toolchain, and got the same error message
when attempting to compile your code after having included
ELFTypes.h in oder to get a definition for Elf32_Addr.
Hmm..where did you download the toolchain?
http://www.hightec-rt.com/downloads/tricore.exe
|
Well..this is stupid windows binary evaluation version (o;
I was talking about GNU gcc/binutils sources (o;
rick |
|
| Back to top |
|
 |
|
|
|
|