Archiv verlassen und diese Seite im Standarddesign anzeigen : Cygwin cross-compiler
Lurch
05.11.2005, 11:15:20
EDIT: This release is deprecated, see Post #53 for the current release 1.8.2.
Hi, here's how I managed to set up a free GCC cross-toolchain for the Gigaset M740 AV on my Windows PC.
This C/C++ compiler runs under Cygwin, which is a Linux-like environment for Windows, but it compiles for Big-Endian MIPS-I architectures, which makes it a Windows hosted cross compiler for the M740 AV target. The toolchain is created with the free uClibc buildroot system from the http://uclibc.org/ site.
This cross-compiler doesn't match exactly to the M740 AV system environment, it's all a bit newer here (I've tried to pick versions which are closest to those of the M740 AV). To give a few examples:
the M740 AV seems to use kernel headers 2.4.21, the cross-toolchain uses 2.4.25
the M740 AV seems to use gcc 3.2.3, the cross-toolchain uses 3.3.5
the M740 AV seems to use uClibc 0.9.19, the cross-toolchain uses 0.9.28
This means you might have trouble running dynamically linked executables, however you can link statically in order to avoid this problem but there might still be cases where even this doesn't help, you're out of luck then.
There's certainly lots of room for improvement here, still I was able to build a simple helloworld binary on my Windows box and to run that on my M740 box (both statically and dynamically linked), so it basically works. Any help/improvements/suggestions highly welcome.
USE THIS INFORMATION AT YOUR OWN RISK!
Prerequisites
You need a fast Windows host system, lots of hard-disk space there, a high-speed internet connection and larger amounts of spare time at your hands, otherwise you'll spoil the fun. Also, install Lemmis unmatched firmware on your M740 AV or you cannot test your cross-compiled binaries (there's really no point in all this unless you have telnet access to your box).
1. Cygwin setup
Install Cygwin from http://cygwin.com/ on your Windows PC and install these extra packages which are needed for the uClibc buildroot system:
automake
bison
flex
gcc
gettext-devel
libncurses-devel
make
patchutils
subversion
wget
If Cygwin setup offers multiple versions of some package, just pick the newest.
Note the "View" button in the top-right corner of Cygwin's package selection dialog, press that button until you see "Full" displayed to the right of it. You'll get a flat list of all available packages when viewing in "Full" mode which makes it a lot easier to find the packages listed above. Click into the second column in order to select a package for installation (terrible interface).
2. Download and unpack the uClibc buildroot system
I recommend you do what follows in your Cygwin home directory (which is the initial directory when you open the shell). Download a copy of buildroot-snapshot.tar.bz2 (http://buildroot.uclibc.org/downloads/snapshots/buildroot-snapshot.tar.bz2) and copy that to your Cygwin home directory. Then open a Cygwin shell and enter:
tar xvjf buildroot-snapshot.tar.bz2
cd buildroot
3. Configure the uClibc buildroot system
To keep it simple, you can use my configuration file, I've attached my .config to this post (it's compressed in the attached file m740av.minimal-config.zip, see below). Copy .config to your "buildroot" folder, then run
make oldconfig
If you want to go through the configuration procedure yourself then do not use my configuration file, instead create your own .config by entering
make menuconfig
There are many options.
4. Build the uClibc toolchain
In your shell, enter
make
Make asks a few questions here. You can usually leave the default values by hitting ENTER, but when it asks for the "Target Processor Endianness" then select "Big Endian" (for which you should enter "2").
There's obviously a problem in the uClibc Makefile which causes make to fail and abort in the middle of everything, I haven't been able to spot the exact problem yet (it comes right after "Entering directory /home/User/buildroot/toolchain_build_mips/uClibc/utils'"). But I was able to find a simple workaround, you have to delete one file after make aborts (actually it's a symbolic link) and then just run make again (make should abort only once):
rm toolchain_build_mips/bin/sed.exe
make
The build process should now complete and terminate without error.
5. Install the toolchain in Cygwin
As mentioned above, I've installed the uClibc buildroot package in my Cygwin home directory, so my install path is simply "~/buildroot". Keep that in mind if you installed it to a different place, you need to modify path names then.
In order to install the cross toolchain only for the current shell (just for testing), enter:
export PATH="$PATH:~/buildroot/build_mips/staging_dir/bin"
In order to install the cross toolchain for all future bash instances (recommended), open "~/.bash_profile" in a text editor and append this line at the end:
PATH=${PATH}:~/buildroot/build_mips/staging_dir/bin
In some exceptional cases it might be neccessary to replace gcc with the cross-gcc instead of having the cross compiler named mips-linux-gcc (you only want to do this temporarily). Use this PATH environment variable setting then instead:
export PATH="~/buildroot/build_mips/staging_dir/mips-linux-uclibc/bin:$PATH"
6. Test the toolchain
Here is a first simple test for the toolchain. Save this C source code to a file named helloworld.c in your Cygwin home directory:
#include <stdio.h>
int main(int argc, char** argv)
{
printf("Hello, world!\n");
return 0;
} Build a dynamically linked executable helloworld_d [8Kb]:
mips-linux-gcc -o helloworld_d helloworld.c
Build a statically linked executable helloworld_s [39Kb]:
mips-linux-gcc -static -Wl,-static -o helloworld_s helloworld.c
After successfull compilation, copy the two binary files to a folder which is accessible from your M740 AV, log in to your M740 AV via telnet and change your working directory to that folder. Run the binaries there with ./helloworld_d and ./helloworld_s, both worked just fine here for me.
A second test: thttpd (http://www.acme.com/software/thttpd/). Grab a copy of thttpd-2.25b.tar.gz (http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz) and copy it to your Cygwin home directory. Please note that you need to replace gcc with the cross-gcc in your Cygwin environment as described above. Then
tar xzf thttpd-2.25b.tar.gz
cd thttpd-2.25b
export CFLAGS=-static LDFLAGS=-Wl,-static
./configure
make
Test it from your M740 AV shell by entering
./thttpd
I only ran the executable once to check, didn't try to configure it.
That's it.
Now, even though my helloworld works, quite a few questions remain regarding the configuration of the uClibc buildroot system:
the M740 AV architecture is a Big-Endian MIPS I, correct?
does the M740 AV have a MMU?
does the M740 AV have a FPU?
does the FPU of the M740 AV support full C99 math?
which version of binutils is used in the M740 AV environment?
uclibc: i18n support? thread support? POSIX Threading (NPTL) support?
gcc: enable setjmp/longjmp exceptions?
I've left the corresponding configuration entries with their defaults in case I didn't know better, but that might of course be wrong in some cases.
I'm sure there are a zillion things to be aware of when building cross-toolchains, it's my first and so my knowledge in this field is very limited. For example, I'm unsure about the side effects when using these newer versions of kernel-headers, gcc and uClibc. These three packages are contained in the GPL licensed code published from Siemens, ideally one would use these, but how? So many questions..
Again, any help/improvements/suggestions highly welcome.
Lurch
die amme
06.11.2005, 13:02:55
Hi.
@ Lurch
Thanks for your good documentation, its really amazing.
I tried yesterday....but i got 2 errors at the end of "make"
With your workaround:
rm toolchain_build_mips/bin/sed.exe
The same result. :confused:
During the install of the Build of uClibc toolchain the program load a hge amount of ata from the internet....
Size on the harddisk, later. ~ 1 Gbyte
May be you have new information about the two errors. :o
best regards
die amme
Lurch
07.11.2005, 19:13:14
I've read up a bit on the subject and succeeded to build my first Cygwin cross-toolchain which is mostly based on Siemens' GPLed source code (more precisely, on their gcc, kernel-headers and uClibc packages).
The only external package used is binutils-2.15.
I've packed the entire process of downloading, unpacking, building and installing into a single Makefile, see the attached archive cygwin-crosgcc-m740av-1.0.zip. All you need is Cygwin plus five additional Cygwin Packages, see README and INSTALL in the archive for more information.
I've bareley tested it yet, and it seems dynamic builds don't work yet, static seems possible at this stage though. It's still early and I'm sure I'll release better versions of this.
Good luck,
Lurch.
Lurch
08.11.2005, 08:27:36
Dynamically linked executables work again with the release attached below. Executables were looking for shared objects in /usr/local/mips-linux/lib, changed that to /lib (which is where they reside on the M740 AV).
Now both helloworld_s [464KB] and helloworld_d [68KB] work fine again.
If you have the previous version of this package installed, unpack the attached archive to the same folder (overwriting all files) and run
make clean all
This way you avoid downloading and unpacking the source archives again which saves you a considerable amount of time.
See README and INSTALL in the archive for more installation instructions.
Lurch
Lurch
08.11.2005, 17:11:53
Bloodshed Dev-C++ (http://www.bloodshed.net/devcpp.html) is a nice IDE for GCC based compilers (you can find more information about it at The Dev-C++ Resource Site (http://www.bloodshed.net/dev/index.html)), and it's free. Read on if you would like to use it with the M740AV cross compiler, the two get along well.
You might have to change all the path names that follow, depending on the location of your Cygwin installation. I've installed it to C:\Programme\cygwin, replace that with whatever you've installed it to.
Start Dev-C++, open the main menu and select Tools/Compiler Options in order to open Dev-C++'s compiler setup window. Create a new compiler profile by clicking on the little green "+" button, give it some meaningfull name like "M740AV Cross-GCC". Then you need to change at least the following settings in the M740AV compiler options:
Directories/Binaries
C:\Programme\cygwin\bin
C:\Programme\cygwin\usr\local\mips-linux\bin
Directories/Libraries
C:\Programme\cygwin\usr\local\mips-linux\lib
Directories/C Includes
C:\Programme\cygwin\usr\local\mips-linux\include
Directories/C++ Includes
<empty>
Programs/gcc
mips-uclibc-gcc.exe
That's it. Now you can develop, debug and profile C applications with GCC for Windows, and when you're done you can create a final build for the M740 AV simply by selecting a different compiler in the IDE. You can switch compilers anytime.
Lurch
die amme
08.11.2005, 18:36:36
Hello,
thanks for your help.
I will try it today. I know about the Bloodshed Dev-C++.
Great idea.
Best regards
die amme
PS: Geht klar! ;)
Lurch
08.11.2005, 18:53:40
Hello,
thanks for your help.
I will try it today. I know about the Bloodshed Dev-C++.
Great idea.
Best regards
die ammeHi amme, thank you.
I'm sorry but it's close to impossible for me to tell from the distance where and why your first attempt failed. The good news is that you can just forget about it, try the latest release (attached to Post #4) and see if that works now. I'm taking a totally different approach there, not related to the first release.
There are only two things that I can come up with that could have gone wrong: First, make sure you have the correct Cygwin packages installed, read in INSTALL about the versions I've tested it with. Second, when installing Cygwin, try to avoid whitespace in its installation path as I have not tested if that is allowed or not.
Lurch
colomy
09.11.2005, 15:30:29
Das makefile aus cygwin-crosgcc-m740av-1.1.zip funktioniert bei mir sehr bis zum Punkt:
tar xjf download/gigaset_m740av_gplsw_1495_14711CF.tar.bz2
tar: gigaset_m740av_gplsw/uClibc/include/asm-generic: Cannot open: No such file or directory
tar: gigaset_m740av_gplsw/linux-2.4-xfs/lib/modules/2.4.2_hhl20/build: Cannot open: No such file or directory
tar: gigaset_m740av_gplsw/linux-2.4-xfs/lib/modules/2.4.16-xfs/build: Cannot open: No such file or directory
tar: gigaset_m740av_gplsw/linux-2.4-xfs/lib/modules/2.4.21-xfs/build: Cannot open: No such file or directory
tar: gigaset_m740av_gplsw/linux-2.4-xfs/lib/modules/2.4.19-rc5-xfs/build: Cannot open: No such file or directory
tar: gigaset_m740av_gplsw/linux-2.4-xfs/linux/include/asm-generic/asm: Cannot open: No such file or directory
tar: Error exit delayed from previous errors
make: *** [gigaset_m740av_gplsw] Error 2
$ ls -l gigaset_m740av_gplsw/uClibc/include/asm-generic
lrwxrwxrwx 1 sr Kein 61 Nov 9 12:33 gigaset_m740av_gplsw/uClibc/include/asm-generic -> /homes/linux/jrathert/linux-2.4-xfs/linux/include/asm-generic
Im tar file sind anscheinend links auf directories, die bei mir nicht existieren. Warum tar deshalb Fehler meldet ist mir nicht klar??
Lurch
09.11.2005, 16:02:52
tar xjf download/gigaset_m740av_gplsw_1495_14711CF.tar.bz2
tar: gigaset_m740av_gplsw/uClibc/include/asm-generic: Cannot open: No such file or directory Hi colomy, I think your archive is corrupt (though I'm really puzzled how that could happen). Anyway, here's how you can find out which part is broken: Open a Cygwin shell, cd to your cross-toolchain installation directory and enter:
cd download
md5sum *
After a short while, you'll get a MD5 checksum for each file. Here are my checksums for you to compare:
d92523b106ff84163669844009da2ac5 *GNU_GPL_LGPL__1495_14711.pdf
624e6b74983ac6b2960edaf2d522ca58 *binutils-2.15.tar.bz2
3c4985bb851de93eb6bc52b8fef2f295 *gigaset_m740av_gplsw_1495_14711CF.tar.bz2
038bf7a074be2f289b81ec3b97137412 *m740av_1495_14711CF.001
946f24927c4e629e7a4e82c79d50b0e2 *m740av_1495_14711CF.002
dafb047b1e998d958e12a147350ebfef *m740av_1495_14711CF.003
971a86eafd0de57fd5f720bf9343033d *m740av_1495_14711CF.004
2c7bd4fb602cce685ec4be25c2e70900 *m740av_1495_14711CF.005
475dc207ce791605d44ae9840dd86348 *m740av_1495_14711CF.006
ac988d3c0e961e1dcd8934e25c18ba02 *m740av_1495_14711CF.007
caaa27760a51248227cd5e8604d4075d *m740av_1495_14711CF.008
d5c07ee09038731902c45f01195df216 *m740av_1495_14711CF.009
9601c455c685b7bcc8c63d59f331bbde *m740av_1495_14711CF.010
5bda9240504d2fb6ff6a1ef570becf0b *m740av_1495_14711CF.011
8c967e84baba974789873cf345c0ecb5 *m740av_1495_14711CF.012
887cd008c495da3b0a66d7f1b6663a65 *m740av_1495_14711CF.013
287f2ab61dd7bc7648d317c49c2851f5 *m740av_1495_14711CF.014
30540239d0e66f7328d22bc0fd079e7b *m740av_1495_14711CF_readme.txt
You should be able to find the corrupted file this way. Just delete it and run
make clean all again (don't forget to set your PATH, see INSTALL).
Lurch
colomy
11.11.2005, 08:09:21
Ich habe den Fehler einfach ignoriert und das Makefile so geändert, dass keine Abhängigkeiten zu dem tar Schritt mehr da sind.
Dann funktioniert es.
Danke für die komfortable Installation !!
Colomy
die amme
11.11.2005, 20:22:53
Hi all,
i have the same problem:
tar xjf download/gigaset_m740av_gplsw_1495_14711CF.tar.bz2
tar: gigaset_m740av_gplsw/uClibc/include/asm-generic: Cannot open: No such file or directory
tar: gigaset_m740av_gplsw/linux-2.4-xfs/lib/modules/2.4.2_hhl20/build: Cannot open: No such file or directory
tar: gigaset_m740av_gplsw/linux-2.4-xfs/lib/modules/2.4.16-xfs/build: Cannot open: No such file or directory
tar: gigaset_m740av_gplsw/linux-2.4-xfs/lib/modules/2.4.21-xfs/build: Cannot open: No such file or directory
tar: gigaset_m740av_gplsw/linux-2.4-xfs/lib/modules/2.4.19-rc5-xfs/build: Cannot open: No such file or directory
tar: gigaset_m740av_gplsw/linux-2.4-xfs/linux/include/asm-generic/asm: Cannot open: No such file or directory
tar: Error exit delayed from previous errors
make: *** [gigaset_m740av_gplsw] Error 2
The last days i tried many times again after post #4
but erverytime something goes wrong. :cool:
Very often the end result is as the note above. Very strange.
Maybe you can help me, for what is this "asm-generic" necessary?
hmm, the file "build" from "gigaset_m740av_gplsw/linux-2.4-xfs/lib/modules/2.4.16-xfs/" contains a symbolic link with the content:
\homes\linux\jrathert\linux-2.4-xfs\linux\include\asm --> gigaset_m740av_gplsw\linux-2.4-xfs\linux\include\asm-generic\asm
:confused:
If i try to restore the file from the archive with rar:
! C:\cygwin\home\TT\install_t\download\gigaset_m740a v_gplsw_1495_14711CF.tar.bz2: Konnte \homes\linux\jrathert\linux-2.4.2_hhl20
(\homes\linux\jrathert\linux-2.4.2_hhl20 --> gigaset_m740av_gplsw\linux-2.4-xfs\lib\modules\2.4.2_hhl20\build) nicht öffnen!
C:\cygwin\home\TT\install_t\download\gigaset_m740a v_gplsw_1495_14711CF.tar.bz2: Konnte \homes\linux\jrathert\linux-2.4.16-xfs\linux
(\homes\linux\jrathert\linux-2.4.16-xfs\linux --> gigaset_m740av_gplsw\linux-2.4-xfs\lib\modules\2.4.16-xfs\build) nicht öffnen!
c:\cygwin\home\TT\install_t\download\gigaset_m740a v_gplsw_1495_14711CF.tar.bz2: Konnte \home\jrathert\linux-2.4-xfs\linux
(\home\jrathert\linux-2.4-xfs\linux --> gigaset_m740av_gplsw\linux-2.4-xfs\lib\modules\2.4.21-xfs\build) nicht öffnen!
C:\cygwin\home\TT\install_t\download\gigaset_m740a v_gplsw_1495_14711CF.tar.bz2: Konnte \homes\linux\jrathert\linux-2.4-xfs\linux
(\homes\linux\jrathert\linux-2.4-xfs\linux --> gigaset_m740av_gplsw\linux-2.4-xfs\lib\modules\2.4.19-rc5-xfs\build) nicht öffnen
Maybe the archive is corrupt, but how-to get the archive?
My md5sum is the same as in post above.
My checksums:
d92523b106ff84163669844009da2ac5 *GNU_GPL_LGPL__1495_14711.pdf
624e6b74983ac6b2960edaf2d522ca58 *binutils-2.15.tar.bz2
3c4985bb851de93eb6bc52b8fef2f295 *gigaset_m740av_gplsw_1495_14711CF.tar.bz2
038bf7a074be2f289b81ec3b97137412 *m740av_1495_14711CF.001
946f24927c4e629e7a4e82c79d50b0e2 *m740av_1495_14711CF.002
dafb047b1e998d958e12a147350ebfef *m740av_1495_14711CF.003
971a86eafd0de57fd5f720bf9343033d *m740av_1495_14711CF.004
2c7bd4fb602cce685ec4be25c2e70900 *m740av_1495_14711CF.005
475dc207ce791605d44ae9840dd86348 *m740av_1495_14711CF.006
ac988d3c0e961e1dcd8934e25c18ba02 *m740av_1495_14711CF.007
caaa27760a51248227cd5e8604d4075d *m740av_1495_14711CF.008
d5c07ee09038731902c45f01195df216 *m740av_1495_14711CF.009
9601c455c685b7bcc8c63d59f331bbde *m740av_1495_14711CF.010
5bda9240504d2fb6ff6a1ef570becf0b *m740av_1495_14711CF.011
8c967e84baba974789873cf345c0ecb5 *m740av_1495_14711CF.012
887cd008c495da3b0a66d7f1b6663a65 *m740av_1495_14711CF.013
287f2ab61dd7bc7648d317c49c2851f5 *m740av_1495_14711CF.014
30540239d0e66f7328d22bc0fd079e7b *m740av_1495_14711CF_readme.txt
Maybe some one has an idea?
Wooh, the last try works now. I didn't knew why...
:confused:
Now the first Hello World works. Thanks.
But the file size is:
68kbyte <-- dynamic
465 kbyte <-- static, but occurs an error... something goes wrong with the
linker, the file was created.
I used the following:
dynamic:
mips-uclibc-gcc -o hello hello.c
static:
mips-uclibc-gcc -static -Wl,-static -o hellos hello.c
Best regards
die amme.
Lurch
12.11.2005, 14:34:49
Good news: Beginning with this release, the Cygwin cross toolchain supports both C and C++! Up until now you actually only got a bootstrap GCC with C language support, now it's a full-blown cross-GCC 3.2.3 for C/C++ (note that there are shared C++ libraries on the M740 AV). It was a bit difficult to figure out why dynamically linked C++ binaries would segfault at first, but I was able to fix that and I'm proud to say that all 4 cases of my simple helloworld test case now build and run just fine:
statically linked C
dynamically linked C (shared)
statically linked C++
dynamically linked C++ (shared)
There's only one issue left (lack of locales support in Cygwin), but there are chances that I find a way to fix that, I'll look into this soon (I have an idea there).
@colomy, amme and anyone else for whom make failed when extracting the huge tar archive from Siemens: First, please read the documentation in the archive again, there's a lot more information there now. Then, try upgrading the way I describe in section 2 of INSTALL, and if that still doesn't work then read the last section to find out how to work around this problem alltogether (if you unpack manually in the correct way then make will simply skip this step, that should do the trick in case everything else fails). Run make test after everything is done to test the four cases listed above.
Please see the files README and INSTALL in the archive for information on how to build, install, test and use the Cygwin cross toolchain for the M740 AV (no matter if you are upgrading or installing the first time). There's also a section on how to enable support in the Bloodshed Dev-C++ IDE for this compiler (now updated for C++).
Happy hacking,
Lurch.
die amme
12.11.2005, 16:03:46
Hi Lurch,
thanks for your time. ;) .I'm runnig your upgrade now. looks nice!
Best regards
die amme
Lurch
14.11.2005, 06:15:02
Hi, the cross gcc now builds under Linux too (tested with Debian/sarge). Like under Windows/Cygwin, it cross compiles and links C and C++, linked either shared or statically.
Please see the files README and INSTALL in the attached archive cygwin-crosgcc-m740av-1.3.zip for information on how to build, install, test and use the GNU cross toolchain for the M740 AV.
Note: If you're upgrading from an earlier release, a simple make clean all will do (this will skip any downloads or unpacking steps).
Greets,
Lurch.
Lurch
14.11.2005, 19:54:55
Many little improvements in release 1.4, most notably: binutils upgraded from 2.15 to 2.16.1, and the first add-on library from Siemen's source codes libiconv (you can optionally build that with make libiconv once you have a complete cross toolchain). Also: the linker warning when linking C++ applications is fixed.
Features in this release:
entire M740 AV cross toolchain is build from scratch
cross toolchain can be hosted under Microsoft Windows or Linux
based on binutils 2.16.1 *updated*
all other source code packages taken from the GPLed sources released by Siemens, hence it should be safe to link against the shared libraries on the M740 AV
cross compiler is GCC 3.2.3 for the mips-linux target
cross toolchain supports both C and C++
cross toolchain supports both static and shared (dynamic) linking
add-on libraries: libiconv (more to come) *new*
downloads and unpacks missing source code archives automatically
contains a simple helloworld test case for C and C++
easy integration with the Bloodshed Dev-C++ IDE (Windows)
simple installation: unpack and run make
Please see the files README and INSTALL in the attached archive cygwin-crosgcc-m740av-1.4.zip for information on how to build, install, test and use the GNU cross toolchain for the M740 AV.
Lurch.
Lurch
17.11.2005, 06:09:57
I'm making progress with the add-on libraries. In order to build them enter make libraries in the command line after making your toolchain. Features in this release:
entire M740 AV cross toolchain is build from scratch
cross toolchain can be hosted under Microsoft Windows or Linux
based on binutils 2.16.1
all other source code packages taken from the GPLed sources released by Siemens, hence it should be safe to link against the shared libraries on the M740 AV
cross compiler is GCC 3.2.3 for the mips-linux target
cross toolchain supports both C and C++
cross toolchain supports both static and shared (dynamic) linking
add-on libraries: libiconv zlib libpng libid3 libproc *new*
downloads and unpacks missing source code archives automatically
contains a simple helloworld test case for C and C++
easy integration with the Bloodshed Dev-C++ IDE (Windows)
simple installation: unpack and run make
Please see the files README and INSTALL in the attached archive m740av-xgcc-1.5.zip for information on how to build, install, test and use the GNU cross toolchain for the M740 AV.
Lurch.
die amme
18.11.2005, 18:40:00
Hello Lurch.
Great work, fine thanks! ;)
No errors! and small files.
Best regards
die amme
Lurch
20.11.2005, 10:58:56
Hi again, the list of libraries is complete now, all ten libraries in the M740AV's /lib and /usr/lib folders that I could match to the source tree can now be cross-build and installed together with the cross toolchain, plus libupnp which is not included in the official firmware (1.50.6, and thus not included in the released sources), but in the 2.0.x-betas.
In case you wonder, here's why the libraries are important: When the GNU linker ld (which is the linker in the cross toolchain) searches for libraries, it prefers shared libraries over static ones. If it finds a shared library it does not link the libraries code into your executable (that would be static linking), instead it only puts code in there that loads the shared library when the executable is started. This has two advantages:
your executable is smaller, on disk and in memory (latter only if it reuses shared libs)
your executable will use Siemens' real libraries, if started on the M740 AV
For example, take libjpeg. This library implements JPEG related functions, amongst others a function that decompresses JPEG images. Looking at Siemens' source tree, it's very obvious that their libjpeg implementation was hacked up to take advantage of the dedicated hardware on the M740 AV. Unfortunately, the source code is incomplete and it refuses to build unless we trick our way around this problem (see the libjpeg section in my Makefile for a longer comment on this issue). However, if we link against a shared libjpeg that exposes the same profile to the linker like the real one from Siemens does, we can just use libjpeg and it will feature hardware-accelerated JPEG decompression on the box.
Another example: libdirectfb (home page (http://www.directfb.org/)). libdirectfb uses libjpeg, hence you have hardware-accelerated JPEG decompression in libdirectfb.
This project looks complete to me now, that is it unless I find any bugs or fixes to remaining problems.
If you have installed a previous version of this toolchain builder, please run
make realclean to uninstall everyting (also please read README and INSTALL again, lots of updates and changes there). To build and install the toolchain, run
make and then, in order to build the libraries (optional but recommended), run
make libraries
Here the complete list of features in this release:
entire M740 AV cross toolchain is build from scratch
cross toolchain can be hosted under Microsoft Windows or Linux
based on binutils 2.16.1
all other source code packages taken from the GPLed sources released by Siemens, hence it should be safe to link against the shared libraries on the M740 AV
cross compiler is GCC 3.2.3 for the mips-linux target
cross toolchain supports both C and C++
cross toolchain supports both static and shared (dynamic) linking
add-on libraries: libtermcap, libiconv, libz, libproc, libpng, libjpeg, libid3, libfreetype, libdirectfb, libsmbclient, libupnp *new*
downloads and unpacks missing source code archives automatically
contains a simple helloworld test case for C and C++
easy integration with the Bloodshed Dev-C++ IDE (Windows)
simple installation: unpack and run make
Please see the files README and INSTALL in the attached archive m740av-xgcc-1.6.zip for information on how to build, install, test and use the GNU cross toolchain for the M740 AV.
Happy hacking,
Lurch.
Lurch
22.11.2005, 05:57:43
Fixed a bug in uClibc which caused mips-uclibc-ldd to fail with a segmentation violation. This mips-uclibc-ldd is the ELF utility which dumps the list of required shared libraries by any mips-linux binary (executable or library) to stdout. It's part of the cross toolchain, that means that like the rest of the mips-uclibc-* binaries, mips-uclibc-ldd runs only on the host where you build (Windows or Linux), but there's also one which runs natively on the box (see build/uClibc/ldso/util/ldd.target, you can execute it in a M740 AV shell).
This release has the same features like the previous one (previous post).
Lurch
EDIT: Attachment updated, had to fix a typo in Makefile :o
elseif
01.12.2005, 21:49:04
You need a fast Windows host system, lots of hard-disk space there,
Wieviel Plattenplatz wird denn ungefähr benötigt und geht das auch mit XPhome?
NullPtr
01.12.2005, 22:29:26
Wieviel Plattenplatz wird denn ungefähr benötigt und geht das auch mit XPhome?
Zuerst die einfache Antwort: Es geht auch mit XP-Home.
Den Löwenanteil beim Download machen die Siemens-Quellen mit etwa 140MB aus, ein komplettes Cygwin etwa weitere 40MB; komplett installiert (nach dem make-Durchlauf incl. make libraries, nachladen diverser Komponenten) sind es dann etwa 1,5 GB auf der Platte.
Dazu ein paar zusätzliche MB für eine IDE nach Gusto.
Lurch
02.12.2005, 16:57:17
Zuerst die einfache Antwort: Es geht auch mit XP-Home.
Den Löwenanteil beim Download machen die Siemens-Quellen mit etwa 140MB aus, ein komplettes Cygwin etwa weitere 40MB; komplett installiert (nach dem make-Durchlauf incl. make libraries, nachladen diverser Komponenten) sind es dann etwa 1,5 GB auf der Platte.
Dazu ein paar zusätzliche MB für eine IDE nach Gusto. Die 1,5G entstehen beim Erzeugen der Cross Toolchain, können danach aber ohne weiteres gelöscht werden (die Downloads sollte man vielleicht besser stehen lassen, denn wenn ich eine neue Fassung des Builders rausbringe dann werden die wieder gebraucht). Die gesamte Toolchain und alle Cross Libraries/Header werden unter /usr/local/mips-linux/ installiert (insg. ~120M, komprimiert ~30M). Aber so wie es jetzt ist braucht man 1-2G um die Toolchain zu erzeugen.
Es wäre durchaus auch möglich, die toolchain vorübersetzt (für Cygwin) zum Download anzubieten, allerdings fehlt mir dafür geeigneter Web Space, hab' mich da aber auch nicht weiter schlau gemacht. Wenn Interesse besteht und ich irgendwie an Web Space rankomme dann würd' ich's machen.
Lurch
NullPtr
02.12.2005, 17:09:47
Es wäre durchaus auch möglich, die toolchain vorübersetzt (für Cygwin) zum Download anzubieten, allerdings fehlt mir dafür geeigneter Web Space, hab' mich da aber auch nicht weiter schlau gemacht. Wenn Interesse besteht und ich irgendwie an Web Space rankomme dann würd' ich's machen.
Danke für das Angebot!
Ich persönlich finde es allerdings, als absoluter Neuling auf diesem Terrain, viel spannender, dem make bei der Arbeit zuzusehen ;)
Also die Box hab ich jetzt schon eine ganze Weile (bald ein Jahr). Und nun juckt es mich auch in den Finger mal was eigenes zu schreiben (wir machen gerad Kurzarbeit :( und da hab ich jede menge Zeit). Also flux Cross-Compiler unter Windows inklusive Bloodshed Dev-C++ nach dieser Anleitung (dickes Dankeschön an Lurch für die beschreibung) installiert.
Hat auch wunderbar funktioniert.
Da ich nun aber auch selber etwas auf meinen Fernseher zaubern wollte dacht ich ich könnt zum einstieg zunächst mal das Clock-Demo übersetzten. Und da bin ich nun gescheitert. Der Linker kann diverse referenzen aus der libdirectfb nicht auflösen.
Die einstellungen , sprich setzen der Pfade, habe ich entsprechend der Anleitung gemacht. Außerdem habe ich ncoh zusätzliche Pfadangaben zu den directfb-Headern angegeben.
Könnt ihr mir ein bisscen auf die Sprünge helfen?
Besten Dank im voraus!
PS: Das übersetzen der test-proggies nach installation des Cross-Compielers ging problemlos...
Lurch
05.12.2005, 20:13:18
Da ich nun aber auch selber etwas auf meinen Fernseher zaubern wollte dacht ich ich könnt zum einstieg zunächst mal das Clock-Demo übersetzten. Und da bin ich nun gescheitert. Der Linker kann diverse referenzen aus der libdirectfb nicht auflösen.
Die einstellungen , sprich setzen der Pfade, habe ich entsprechend der Anleitung gemacht. Außerdem habe ich ncoh zusätzliche Pfadangaben zu den directfb-Headern angegeben.
Könnt ihr mir ein bisscen auf die Sprünge helfen? Hi Nioc, hast du clock mit dem Makefile übersetzt? Folgender Einzeler sollte es in jedem Fall tun:
mips-uclibc-gcc -Wall -I/usr/local/mips-linux/include/directfb -ldirectfb -lm -o clock clock.c Welche Referenzen kann der Linker denn nicht auflösen?
Existiert bei dir die Datei /usr/local/mips-linux/lib/libdirectfb.so?
Lurch
EDIT: Ich empfehle erstmal zum Testen auf der Kommandozeile zu übersetzen, dann erst mit einer IDE zu arbeiten (schau Dir dann mal auch CodeBlocks (http://www.codeblocks.org/) an, ist besser als Bloodshed und genauso gut geeignet für die Cross Toolchain).
Hallo Lurch,
erstmal danke für die schnelle Antwort!
hast du clock mit dem Makefile übersetzt?
ehrlich gesagt nein... ich hab's nur aus der IDE probiert. Werd es aber gleich mal mit dem makefile versuchen.
Folgender Einzeler sollte es in jedem Fall tun:
mips-uclibc-gcc -Wall -I/usr/local/mips-linux/include/directfb -ldirectfb -lm -o clock clock.c
auch das werd ich gleich mal versuchen!
Welche Referenzen kann der Linker denn nicht auflösen?
Alos ich glaub das sind so ziemlich alle Funktionen aus der directfb-library; um's genau zu sagen:
+DirectFBInit
+DirectFBCreate
+DirectFBErrorFatal
Außerdem hab ich gerade gesehen, das er nicht mal die Funktionen
+sin
+cos
+rint
findet :confused:
Existiert bei dir die Datei /usr/local/mips-linux/lib/libdirectfb.so?
Ja, die Datei gibt es
Lurch
05.12.2005, 21:06:29
Alos ich glaub das sind so ziemlich alle Funktionen aus der directfb-library; um's genau zu sagen:
+DirectFBInit
+DirectFBCreate
+DirectFBErrorFatal
Außerdem hab ich gerade gesehen, das er nicht mal die Funktionen
+sin
+cos
+rint
findet Alles klar.
Das sind genau die Funktionen, die ich aus den beiden Bibliotheken libdirectfb.so (DirectFB) und libm.so (Math, da liegen die trigonometrischen Funktionen drin) linke. Du hast in Bloodshed übersehen, diese beiden Bibliotheken im Projekt mit einzubinden. Im Bloodshed Menü: "Project" --> "Project Options", dann öffnet das Fenster mit den Projektoptionen. Dort im Reiter "Parameters" im Listenfeld "Linker" zufügen: -ldirectfb und -lm.
Das wird's sein, da bin ich sicher. :)
Viel Erfolg,
Lurch.
so, hab's jetzt mit dem makefile und dem besagten Einzeiler ausprobiert. Das funktioniert beides :) .
Außerdem hab ich Bloodshed Dev-C++ bei den Compiler-Optionen unter
"Diese Befehle zur Linker-Kommandozeile hinzufügen"
die Optionen
-ldirectfb -lm
angegeben. So konnte ich's auch aus der IDE übersetzten.
Mir ist allerdings nicht wirklich klar, was ich da gemacht habe :(
Hat das -lm etwas mit den mathematik-funktionen zu tun? Das würde ja erklären, warum nun auch die Funktionen sin, cos und rint gefunden wurden...
Aber was mach ich den wenn ich funktionen benutzen will die in noch anderen Bibliotheken stehen
Kannst du mich vieleicht ein bisschen aufklären? :o
Da warst du zu schnell für mich...
OK, das klingt schon mal einleuchtend. Aber nun stellt sich mir immer noch die frage, woher ich weiß was ich angeben muß, wenn ich selber weitere Bibliotheken benutzen will. Was muß ich dann denn als Option angeben?
So, und nun war ich ein bisschen zu voreilig... Hätt vieleicht erst mal probieren sollen.
Ich kann die lib-files ja "erbrowsen" und dann werden die entsprechenden Funktionen auch gefunden. Ich glaub nu hab ich das verstanden :)
Besten Dank für die Hilfe
Gruß Robert
Lurch
05.12.2005, 21:38:14
Aber nun stellt sich mir immer noch die frage, woher ich weiß was ich angeben muß, wenn ich selber weitere Bibliotheken benutzen will. Was muß ich dann denn als Option angeben? Erstmal schön zu hören, dass jetzt alles klappt. :)
Deine Frage ist nicht ganz leicht zu beantworten. Im README des Toolchain Builders sind ja ein gutes Dutzend Bibliotheken aufgelistet, google mal nach denen um einen groben Überblick zu kriegen, was "im Angebot" ist. Viel mehr als das gibt's nicht auf der Box, wenn du andere Bibliotheken willst musst du die selbst übersetzen und statisch linken.
Im Allgemeinen gibt's zu jeder Bibliothek im Ordner /usr/local/mips-linux/lib mindestens eine Header-Datei im Ordner /usr/local/mips-linux/include, häufig mit gleichem oder jedenfalls sehr ähnlichem Namen. Auch wenn das am Anfang nach vielen Dateien aussieht, es ist gar nicht so viel und nach einiger Zeit stört das gar nicht weiter groß.
Mir war z.B. libm.so auch neu, aber ich hab neulich, als ich das Problem hatte, einfach nach sin für linux gegoogelt, so über -lm gelernt und es ausprobiert, nachdem ich überprüft hatte das libm.so auf meinem Host und auf der Box existiert.
Volltextsuche über die Bibliotheken kann im Zweifelsfall auch helfen.
Lurch
An dieser Stelle nochmal besten Dank für die Hilfe!!!
Ich konnte jetzt auch erfolgreich tetris (http://www.m740.de/forum/showpost.php?p=8778&postcount=9)
übersetzen :)
...und nun malgucken was ich so zu stande bringe :cool:
Robert
colomy
06.12.2005, 08:57:28
@Lurch
Your make file is excellent. Make life really easy.
What I usually keep from the download is the gigaset_m740av_gplsw_1495_14711CF.tar.bz2.
It would be good if the makefile would recognize this file and does not down load the 10 MB fragments anymore.
colomy
06.12.2005, 12:24:56
Debugging under Dev C++ does not work for me.
In the source view I can not see where I am. Stepping after a break point seems to work, but the position in the source file is not shown.
Also the output of gdb does not show the line feed correctly.
Does this work for you?
Lurch
06.12.2005, 17:13:44
Your make file is excellent. Make life really easy. Thanks! :)
What I usually keep from the download is the gigaset_m740av_gplsw_1495_14711CF.tar.bz2.
It would be good if the makefile would recognize this file and does not down load the 10 MB fragments anymore. If you keep the the big file AND its fragments then things won't be downloaded a second time. I'll change it in the next release such that it'll be sufficient to keep only the big file.
Debugging under Dev C++ does not work for me.
In the source view I can not see where I am. Stepping after a break point seems to work, but the position in the source file is not shown.
Also the output of gdb does not show the line feed correctly.
Does this work for you? I haven't tested debugging yet. AFAIK one can only debug native binaries, no cross binaries. I strongly suggest to move away from Bloodshed and to switch over to CodeBlocks (http://www.codeblocks.org/). That will definitly help in case that Bloodshed's debugging is buggy (duh!), though I do remember to have used it a couple of month ago successfully in a completely different context. CodeBlocks is much better than Bloodshed.
Lurch
colomy
13.12.2005, 19:25:31
This cross-compiler doesn't match exactly to the M740 AV system environment, it's all a bit newer here (I've tried to pick versions which are closest to those of the M740 AV). To give a few examples:
the M740 AV seems to use kernel headers 2.4.21, the cross-toolchain uses 2.4.25
the M740 AV seems to use gcc 3.2.3, the cross-toolchain uses 3.3.5
the M740 AV seems to use uClibc 0.9.19, the cross-toolchain uses 0.9.28
This could be my problem why my kernel module is not working. At least a kernel programmer told me to take care about gcc versions. And not matching kernel headers might be another issue.
How can I put together a tool chain with the same versions the box is using.
I had no probelm finding the uClibc 0.9.19.
But I can not find older verions of the uClibc buildroot system. In the current version it uses newer versions of uClib, kernel headers and gcc.
Can I build the toolchain without the buildroot system?
Lurch
13.12.2005, 20:00:09
Can I build the toolchain without the buildroot system? Hi colomy, please try the latest release m740av-xgcc 1.7 of the cross toolchain builder. Beginning with release 1.1 of the cross toolchain builder I'm using the sources from Siemens wherever possible (and that is, mostly everywhere). It builds under Windows and Linux, you choose.
Good luck with your kernel module. What are you planning?
Lurch.
colomy
14.12.2005, 08:19:12
Hi colomy, please try the latest release m740av-xgcc 1.7 of the cross toolchain builder. Beginning with release 1.1 of the cross toolchain builder I'm using the sources from Siemens wherever possible (and that is, mostly everywhere). It builds under Windows and Linux, you choose.
Good luck with your kernel module. What are you planning?
Lurch.
Good to know. I installed it under cygwin some days ago, but I seem to have some corruption in my cygwin. The compiled binaries are only generating segmentation faults on the box.
The kernel module I try is to get info about the current offset of open files of other processes. The final goal is to display film subtitles synchronized with the playback of recorded films.
colomy
14.12.2005, 11:26:37
I am going through the whole installation again and found that
something fails:
Finally finished compiling...
install -d "/usr/local/mips-linux"/lib
install -d "/usr/local/mips-linux"/usr/lib
install -d "/usr/local/mips-linux"/include
install -m 644 lib/*.[ao] "/usr/local/mips-linux"/lib/
tar -chf - include | tar -xf - -C "/usr/local/mips-linux";
tar: include/asm-generic/asm: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
chmod: cannot access `/usr/local/mips-linux/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/bin/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/i686-pc-cygwin/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/i686-pc-cygwin/mips-linux/*.h': No
....
chmod: cannot access `/usr/local/mips-linux/share/locale/ru/LC_MESSAGES/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/share/locale/sv/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/share/locale/sv/LC_MESSAGES/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/share/locale/tr/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/share/locale/tr/LC_MESSAGES/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/share/locale/zh_CN/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/share/locale/zh_CN/LC_MESSAGES/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/usr/*.h': No such file or directory
chmod: cannot access `/usr/local/mips-linux/usr/lib/*.h': No such file or directory
make[1]: [install_dev] Error 1 (ignored)
find "/usr/local/mips-linux" -name CVS | xargs rm -rf;
chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$/\1.\2/'` "/usr/local/mips-linux"
install -m 644 lib/*.so "/usr/local/mips-linux"/lib/
find lib/ -type l -name '*.so' -exec cp -a {} "/usr/local/mips-linux"/lib ';'
The error is ignored, I assume this is ok then.
Lurch
14.12.2005, 16:18:54
I am going through the whole installation again and found that something fails:
... snip ...The error is ignored, I assume this is ok then. Yes, I think it's ok to ignore this error. Here a few things for you to check/I'd like to know from you:
I recommend to NOT copy binaries to the M740 AV, instead build binaries on your host in a folder which is directly accessible from the M740 AV (network share). This is much better than copying the binaries to the box (beware of FTP file transfer modes!), it's also easier to handle.
I have written several demos for the cross toolchain which you should try. First, try the helloworld demo included in the toolchain builder. Then, try the clock demo (just download this posts attachment), it comes with sources and a precompiled binary for your M740 AV. Unpack this clock demo archive into a folder which is directly accessible from the M740 AV and run it from within a M740 telnet session. There's also a RDF/RSS newsticker which I've written, like the clock demo it has sources and a precompiled cross binary included. Both of these demos have german readmes (ignore them), but the command line options are in english, so you should be able to try both of them (i.e. clock -h). Do these two precompiled binaries run on your box?
which firmware version do you have installed on your M740 AV?
which version of the cross toolchain builder do you use?
which operating system do you use, how old is your cygwin?
Greets,
Lurch.
Edit: Perhaps I should add a few words why I say it's safe to ignore these errors:
include/asm-generic/asm is a symbolic link which stems from gigaset_m740av_gplsw_1495_14711CF.tar.bz2. This symbolic link is a dead link, it points to the absolute location /homes/linux/jrathert/linux-2.4-xfs/linux/include/asm which by any chance will not exist on your host (Siemens' archiving capabilities are kinda.. uuh.. limited, to say the least).
All these inaccessible .../*.h patterns are indeed bogus, they do not match anything and can safely be ignored (these are warnings only)
colomy
15.12.2005, 10:25:58
@ Lurch
Like so often it was only a stupid mistake.
In my make file I had stored the crosscompiler prefix as mips-linux-. This generates executable which crashes at the very beginning.
I saw in your makefile the correct prefix.
Thank you for your help!
I think I found a possible reason why my module is not working correctly. The kernel seems to be compiled with gcc 2.91.
This is the output of /proc/version:
Linux version 2.4.21-xfs (jrathert@borussia) (gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)) #646 Wed Aug 3 10:01:46 CEST 2005
My next try will be to get the egcs-1.1.2 release as a cross compiler for mips.
Hanspeter
15.01.2006, 13:57:32
An dieser Stelle nochmal besten Dank für die Hilfe!!!
Ich konnte jetzt auch erfolgreich tetris (http://www.m740.de/forum/showpost.php?p=8778&postcount=9)
übersetzen :)
...und nun malgucken was ich so zu stande bringe :cool:
Robert
Hi Leute,
bin grade über den Komentar gestolpter. Giebt es ein Tetris für die BOX?
Wenn ja kann mal jemand das programm posten?
Leider reichen mein Kentnisse und ie Zeit nicht aus selber den cross comp zu installieren.
Danke
Hanspeter
3rdparty
23.01.2006, 12:23:12
Hi,
Any one has compiled last version of tool-chain in Cygwin? With up-to-date libraries the "m740av-xgcc-1[1].7.zip" don't compile!
Also erstmal danke für die gute Beschreibung! Ich habe die Toolchain unter Linux (Debian) übersetzt. Es hat leider ein paar Probleme mit den Bibliotheken gegeben, die ich aber lösen konnte...
Die libdirectfb konnte erst nicht übersetzt werden, da der Compiler immer versucht hat lokalen Dateien unter /usr/lib zu benutzen. Der (erste) Fehler war:
make libraries...
mips-uclibc-gcc -shared idirectfbfont_ft2.lo /usr/lib/libfreetype.so -lz -ldl -lpthread -Wl,-soname -Wl,libidirectfbfont_ft2.so -o .libs/libidirectfbfont_ft2.so
/usr/lib/libfreetype.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
Da ich nicht dem ./confirgure nicht mitteilen konnte, dass er die libs aus '/usr/local/mips-linux/lib' nehmen sollte, habe ich die Makefiles (mehrere) direkt editiert!
Lösung:
Falls der Fehler bei dem make auftritt editiere:
-/build/libdirectfb/Makefile
-/build/libdirectfb/interfaces/Makefile
-/build/libdirectfb/interfaces/IDirectFBImageProvider/Makefile
-/build/libdirectfb/interfaces/IDirectFBVideoProvider/Makefile
Geändert werden muss: (< = alt, > = neu)
79,81c79,81
< FREETYPE_CFLAGS = -I/usr/include/freetype2
< FREETYPE_CONFIG = /usr/bin/freetype-config
< FREETYPE_LIBS = -lfreetype -lz
---
> FREETYPE_CFLAGS = -I/usr/local/mips-linux/include -I/usr/local/mips-linux/include/freetype2
> FREETYPE_CONFIG = /usr/local/mips-linux/bin/freetype-config
> FREETYPE_LIBS = -L/usr/local/mips-linux/lib -lfreetype -lz
88c88
< LIBJPEG = -ljpeg
---
> LIBJPEG = -L/usr/local/mips-linux/lib -ljpeg
90c90
< LIBPNG = -lpng -lz -lm
---
> LIBPNG = -L/usr/local/mips-linux/lib -lpng -lz -lm
92c92
< LIBZ = -lz
---
> LIBZ = -L/usr/local/mips-linux/lib -lz
Also bei
-Freetype: z.b: "/usr/local/mips-linux/include" STATT "/usr/include"
-allen *_LIBS: "-L/usr/local/mips-linux/lib" vor dem -l
Dann muss man die Makefile-Datei im Verzeichnis des Cross-Compilers (also wo ihr das "make libraries" macht) anpassen, so dass er beim zweiten(!) Übersetzen (also wenn der Fehler auftritt) nicht wieder die Dateien löscht, die ihr bereits editiert habt:
Folgende Zeilen unter libdirectfb auskommentieren: (also # davor)
# rm -rf build/libdirectfb
# mkdir -p build/libdirectfb
# cd gigaset_m740av_gplsw/DirectFB-0.9.18 && tar cpsSf - . | \
# (cd $(PWD)/build/libdirectfb; tar xf -)
# $(MAKE) -C build/libdirectfb distclean
# cd build/libdirectfb && \
$(MIPS_UCLIBC_TOOLCHAIN) \
./configure \
--prefix=$(PREFIX) \
--host=$(TARGET) \
--build=$$MACHTYPE \
Dann sollte das "make libraries" durchlaufen!!!
Vielleicht kann das jemand in das "make libraries" einbauen, so als diff oder so...
noisehole
05.02.2006, 22:23:02
hi,
danke fuer das Makefile, das macht einem doch wirklich das leben leichter. ich habe erfolgreich den mips crosscompiler auf freebsd 6.0 erstellen koennen, dabei war ich non-root und habe auch nicht nach /local/mips-linux installiert.
zum einen gab es ein paar nicht bsd-kompatible schwierigkeiten aber auch ein paar, die sich durch non-root/pfad ergeben haben:
ist schon spaet, ich schreibe mal in stichworten ;)
irrelevant, aber ich erwaehne es trotzdem:
cat `if [ $OSTYPE = "cygwin" ]; then echo "-B"; fi` download/m740av_1495_14711CF.001 download/m740av_1495_14711CF.002 download/m740av_1495_14711CF.003 download/m740av_1495_14711CF.004 download/m740av_1495_14711CF.005 download/m740av_1495_14711CF.006 download/m740av_1495_14711CF.007 download/m740av_1495_14711CF.008 download/m740av_1495_14711CF.009 download/m740av_1495_14711CF.010 download/m740av_1495_14711CF.011 download/m740av_1495_14711CF.012 download/m740av_1495_14711CF.013 download/m740av_1495_14711CF.014 > download/gigaset_m740av_gplsw_1495_14711CF.tar.bz2
[: =: unexpected operator
bsd-spezifisch
make
-----
gigaset_m740av_gplsw/uClibc/Makefile
make -> @$(MAKE)
libfreetype
GNUMAKE=<GNU make command name> -> GNUMAKE=@$(MAKE)
sed
---
-r nicht existent auf bsd's sed -> gsed
tar
---
weder -s noch -S existieren, es funktionierte aber auch alles ohne wunderbar
build/libtermcap/Makefile /usr/local hardcoded
ldconfig raus
bei der uClibc gab es massig probleme, hab ich mir nicht alles notiert, wenn du aber interesse dran hast das Makefile bsd-kompatibel zu halten, lass ich nochmal alles durchlaufen
noisehole
Lurch
05.03.2006, 04:45:11
Any one has compiled last version of tool-chain in Cygwin? With up-to-date libraries the "m740av-xgcc-1.7.zip" don't compile! Hi 3rdparty, end of last year something was changed in Cygwin, and I'm not able to find out what that is. I've repeatedly tried to find the underlying issue, but had no luck so far (but then, I'm not an expert in this).
In order to build the cross toolchain, I had to remove Regular Expression support in uClibc and also the entire C++ support. So this release is not as complete as the previous 1.7, but at least it compiles again. I ran a few tests here and the toolchain looks ok.
Here is the complete list of features in this release:
entire M740 AV cross toolchain is build from scratch
cross toolchain can be hosted under Microsoft Windows or Linux
based on binutils 2.16.1
all other source code packages taken from the GPLed sources released by Siemens, hence it should be safe to link against the shared libraries on the M740 AV
cross compiler is GCC 3.2.3 for the mips-linux target
cross toolchain supports C only
cross toolchain supports both static and shared (dynamic) linking
add-on libraries: libtermcap, libiconv, libz, libproc, libpng, libjpeg, libfreetype, libdirectfb, libsmbclient, libupnp
downloads and unpacks missing source code archives automatically
contains a simple helloworld test case for C and C++
easy integration with the Bloodshed Dev-C++ IDE (Windows)
simple installation: unpack and run make
These features are currently deactivated due to Cygwin troubles:
REGEX support in uClibc
C++ support
libid3
Please see the files README and INSTALL in the attached archive m740av-xgcc-1.8.zip for information on how to build, install, test and use the GNU cross toolchain for the M740 AV.
Greets and good luck,
Lurch.
feliperomero
07.03.2006, 18:44:50
Hi,
I'm newbie, and also I can't speak (or even, understand a bit of) deutsch.
I tried version 1.8 of toolchain and I have the same problems referenced above:
mips-uclibc-gcc -shared idirectfbfont_ft2.lo /usr/lib/libfreetype.so -lz -ldl -lpthread -Wl,-soname -Wl,libidirectfbfont_ft2.so -o .libs/libidirectfbfont_ft2.so
/usr/lib/libfreetype.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
I suppose that the solution given by xna will be enough, but it seems complicated and I can have problems to translate some words. Is there a simpler solution for this problem, or I need to follow the above instructions. Thank you so much,
Felipe
Lurch
07.03.2006, 19:27:37
Hi,
I'm newbie, and also I can't speak (or even, understand a bit of) deutsch.
I tried version 1.8 of toolchain and I have the same problems referenced above:
mips-uclibc-gcc -shared idirectfbfont_ft2.lo /usr/lib/libfreetype.so -lz -ldl -lpthread -Wl,-soname -Wl,libidirectfbfont_ft2.so -o .libs/libidirectfbfont_ft2.so
/usr/lib/libfreetype.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
I suppose that the solution given by xna will be enough, but it seems complicated and I can have problems to translate some words. Is there a simpler solution for this problem, or I need to follow the above instructions. Thank you so much,
Felipe Hello Felipe,
apparently, the libdirectfb Makefile finds and uses /usr/lib/libfreetype.so (native) instead of /usr/local/mips-linux/lib/libfreetype.so (cross) on your system, and this really should not happen, no matter if the former file exists or not. The cross linker can only link cross compiled object files and libraries, if you feed it something else (like in this case, a native library) it will abort with the "File in wrong format" error message that you stumbled about.
xna was so kind to share his solution here (thanks for that, by the way) which describes a way to manually patch the Makefiles so that they link against the correct libfreetype.so. I will look into this in the next couple of days, I'll post a new release then after I checked some solutions.
If you don't need it, you could also uninstall your native libfreetype Package and rebuild the cross libraries, I guess that should also fix it, but it's of course better to wait until I've really looked into it.
Lurch
feliperomero
07.03.2006, 19:31:24
Lurch: but it's of course better to wait until I've really looked into it.
I'll do that. Thanks, so much!!
Lurch
07.03.2006, 20:38:45
@xna, feliperomero: Ok, problem is that I cannot reproduce the problem here, but I've taken a look and I'm quite sure that this is the solution:
open the 1.8 cross toolchain makefile with a text editor
search for "libdirectfb:"
in that section, replace
./configure \
--prefix=$(PREFIX) \
--host=$(TARGET) \
--build=$$MACHTYPE \
--with-gfxdrivers=none \
--without-tools
with this (red text appended):
./configure \
--prefix=$(PREFIX) \
--host=$(TARGET) \
--build=$$MACHTYPE \
--with-gfxdrivers=none \
--without-tools \
FREETYPE_CONFIG=$(PREFIX)/bin/freetype-config
save your changes
test with make libdirectfb
if it works, rebuild all libraries with make libraries
Note: Early, at the initialization of make libdirectfb, it now should read
checking for freetype-config... /usr/local/mips-linux/bin/freetype-config
As I said, I cannot test this, so I need you to tell me if this fixes the problem.
So long,
Lurch.
Lurch
16.03.2006, 18:37:50
Hi again,
the toolchain still fails to build with the current Cygwin, but I've found two ways to build the complete toolchain (including C++ and libid3) under Windows now:
downgrade Cygwin - you can downgrade the entire Cygwin installation through its setup utility. I still cannot single out the responsible packages, but downgrading the whole shebang works. Side note: After building the toolchain in a downgraded Cygwin, I upgraded to the current Cygwin and then attempted to build the libraries. This failed, so it must be something which also affects the Cygwin runtime enviornment (nasty).
install coLinux (http://www.colinux.org/) (Cooperative Linux) - not that easy to set up, but it works extremly nice once you're through with the installation. I used the Debian woody-Image, upgraded the dist to sarge and updated all packages, created me a 4G block_device file and built the cross toolchain in there (it needs > 1G hard disk space to build, the Debian image is only 1G).
Please note that I do not support the current Version of Cygwin.
If you have installed a previous version of this toolchain builder, please run a make clean and delete everything except for the download folder. To build and install the toolchain, run
make and then, in order to build the libraries (optional but recommended), run
make libraries
Here the complete list of features in this release:
entire M740 AV cross toolchain is build from scratch
cross toolchain can be hosted under Microsoft Windows or Linux
based on binutils 2.16.1
all other source code packages taken from the GPLed sources released by Siemens, hence it should be safe to link against the shared libraries on the M740 AV
cross compiler is GCC 3.2.3 for the mips-linux target
cross toolchain supports both C and C++
cross toolchain supports both static and shared (dynamic) linking
add-on libraries: libtermcap, libiconv, libz, libproc, libpng, libjpeg, libid3, libfreetype, libdirectfb, libsmbclient, libupnp
downloads and unpacks missing source code archives automatically
contains a simple helloworld test case for C and C++
easy integration with the Codeblocks IDE (Windows)
simple installation: unpack and run make
Please see the files README and INSTALL in the attached archive m740av-xgcc-1.8.1.zip for information on how to build, install, test and use the GNU cross toolchain for the M740 AV.
Lurch
tatnat
23.03.2006, 07:33:48
Also erstmal danke für die gute Beschreibung! Ich habe die Toolchain unter Linux (Debian) übersetzt. Es hat leider ein paar Probleme mit den Bibliotheken gegeben, die ich aber lösen konnte...
..
Schliesse mich dem Dank an.
Ich habe alles unter Linux (Ubuntu 5.10) übersetzt. Das einzige Problem war das -B Flag beim cat. Der gcc-compiler ist die Version 3.4.5, nicht die Standardversion 4.0.x!
Ein Versuch unter Suse 10.0 ging schief. Die gcc-Version 4.0.2 hat sich irgendwann über einen falschen lvalue beschwert. Das Makro sieht aber richtig aus und die 3.4.3er hat es ja auch anstandslos und offensichtlich korrekt übersetzt.
Jetzt werde ich mal mit dem menu2osd spielen. Meine Plan ist die Ansteuerung der Jalousien vom Fernseher aus.
Ciao,
tatnat
Hi.
I got the same error with the cat Option "-B" in your makefile like tatnat. I'm using Debian linux and got the error "cat: Ungültige Option -- B" in the M740AV-XGCC: Concatenating 'gigaset_m740av_gplsw_1495_14711CF.tar.bz2' section. I comment it out and fix it manualy. If you got this error you can replace "cat $(BINCAT_OPTS)" with "cat".
And
@xna, feliperomero: Ok, problem is that I cannot reproduce the problem here, but I've taken a look and I'm quite sure that this is the solution:
...
Thanx for your solution, though it's not. I tried now the old and new version and found out the correct solution. Your hint helps ;) The problem is that (i guess) the library libdirectfb needs libfreetype and this is installed also in "/usr/liblibfreetype.so" on my system (debian, linux). You need the
LDFLAGS and (maybe) FREETPYE_CFLAGS.
I add the two red lines in section libdirectfb in your Makefile:
cd build/libdirectfb && \
$(MIPS_UCLIBC_TOOLCHAIN) \
./configure \
--prefix=$(PREFIX) \
--host=$(TARGET) \
--build=$$MACHTYPE \
--with-gfxdrivers=none \
--without-tools \
FREETYPE_CONFIG=$(PREFIX)/bin/freetype-config \
FREETPYE_CFLAGS="-I/usr/local/mips-linux/include/" \
LDFLAGS="-L/usr/local/mips-linux/lib"
And it works!
O.k. Something else. I tried to compile a "...printf("hello world")..." with the mips-linux-gcc (not mips-uclibc-gcc) and got an "Segment fault" on the box. On this chroot-environment (http://www.m740.de/forum/showpost.php?p=31513&postcount=47) I got an "sh: ./test: No such file or directory" which I found very weird because it's no shell-script and ./test exists.
Do you know why this problem occur? I compile only with "mips-linux-gcc -o test test.c". Does the mips-linux-gcc works with glibc?
Lurch
26.03.2006, 05:18:58
Hi.
I got the same error with the cat Option "-B" in your makefile like tatnat. I'm using Debian linux and got the error "cat: Ungültige Option -- B" in the M740AV-XGCC: Concatenating 'gigaset_m740av_gplsw_1495_14711CF.tar.bz2' section. I comment it out and fix it manualy. If you got this error you can replace "cat $(BINCAT_OPTS)" with "cat".
And
Thanx for your solution, though it's not. I tried now the old and new version and found out the correct solution. Your hint helps ;) The problem is that (i guess) the library libdirectfb needs libfreetype and this is installed also in "/usr/liblibfreetype.so" on my system (debian, linux). You need the
LDFLAGS and (maybe) FREETPYE_CFLAGS.
I add the two red lines in section libdirectfb in your Makefile:
cd build/libdirectfb && \
$(MIPS_UCLIBC_TOOLCHAIN) \
./configure \
--prefix=$(PREFIX) \
--host=$(TARGET) \
--build=$$MACHTYPE \
--with-gfxdrivers=none \
--without-tools \
FREETYPE_CONFIG=$(PREFIX)/bin/freetype-config \
FREETPYE_CFLAGS="-I/usr/local/mips-linux/include/" \
LDFLAGS="-L/usr/local/mips-linux/lib"
And it works! Great! I've added these two lines to the makefile.
Also, I've moved away from the NOW-Portal to the new Siemens download site for the gigaset source archive. Since the sources are no longer fragmented there I don't need the cat any more.
The next release of the toolchain builder should work out of the box for you.
O.k. Something else. I tried to compile a "...printf("hello world")..." with the mips-linux-gcc (not mips-uclibc-gcc) and got an "Segment fault" on the box. On this chroot-environment (http://www.m740.de/forum/showpost.php?p=31513&postcount=47) I got an "sh: ./test: No such file or directory" which I found very weird because it's no shell-script and ./test exists.
Do you know why this problem occur? I compile only with "mips-linux-gcc -o test test.c". Does the mips-linux-gcc works with glibc? The mips-uclibc-X files are mostly symlinks to the mips-linux-X binary files, but mips-uclibc-gcc is real, it's a wrapper which invokes the underlying mips-linux-gcc with a modified command line. You can look at the source code at gigaset_m740av_gplsw/uClibc/extra/gcc-uClibc/gcc-uClibc.c. You can also see a bit of what's going on when you invoke mips-uclibc-gcc with the -v (verbose) flag.
I think you can use mips-linux-gcc to compile object files and libraries, but not executables. It's best to avoid the mips-linux-X toolchain alltogether, use the mips-uclibc-X line of files instead (that's what I usually do).
Lurch
Lurch
26.03.2006, 06:24:02
Hi,
this release of the toolchain builder contains the recent patch from xna plus the new download site from Siemens (the NOW Portal is being closed).
If you want to build under Cygwin, you have to downgrade the entire Cygwin environment, then upgrade only the packages crypt and bash (or exclude them from downgrading in the first place). It should build under linux without problems.
To build and install the toolchain, run
make and then, in order to build the libraries (optional but recommended), run
make libraries
Here the complete list of features in this release:
entire M740 AV cross toolchain is build from scratch
cross toolchain can be hosted under Microsoft Windows or Linux
based on binutils 2.16.1
all other source code packages taken from the GPLed sources released by Siemens, hence it should be safe to link against the shared libraries on the M740 AV
cross compiler is GCC 3.2.3 for the mips-linux target
cross toolchain supports both C and C++
cross toolchain supports both static and shared (dynamic) linking
add-on libraries: libtermcap, libiconv, libz, libproc, libpng, libjpeg, libid3, libfreetype, libdirectfb, libsmbclient, libupnp
extra libraries: libexpat, libxml2
downloads and unpacks missing source code archives automatically
contains a simple helloworld test case for C and C++
easy integration with the Codeblocks IDE (Windows)
simple installation: unpack and run make
Please see the files README and INSTALL in the attached archive m740av-xgcc-1.8.2.zip for information on how to build, install, test and use the GNU cross toolchain for the M740 AV.
Lurch
glotzi
27.03.2006, 14:30:20
Super Sache mit dem Makefile, leider läufts bei mir nicht durch: :mad:
mips-linux-ar r ../../../libc/libc.a hsearch.o tsearch.o tfind.o tdelete.o twalk.o lfind.o lsearch.o insque.o remque.o hcreate_r.o hdestroy_r.o hsearch_r.o
make[4]: Leaving directory `/cygdrive/c/down/m740av-xgcc-1.8.2/build/uClibc/libc/misc/search'
make -C regex
make[4]: Entering directory `/cygdrive/c/down/m740av-xgcc-1.8.2/build/uClibc/libc/misc/regex'
mips-linux-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -Os -fno-builtin -nostdinc -D_LIBC -I../../../include -I. -I/usr/local/mips-linux/lib/gcc-lib/mips-linux/3.2.3/include -DNDEBUG -fPIC -c regex.c -o regex.o
In file included from regex.c:646:
regex.c: In function `byte_re_match_2_internal':
regex.c:7627: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[4]: *** [regex.o] Error 1
make[4]: Leaving directory `/cygdrive/c/down/m740av-xgcc-1.8.2/build/uClibc/libc/misc/regex'
make[3]: *** [_dir_regex] Error 2
make[3]: Leaving directory `/cygdrive/c/down/m740av-xgcc-1.8.2/build/uClibc/libc/misc'
make[2]: *** [_dir_misc] Error 2
make[2]: Leaving directory `/cygdrive/c/down/m740av-xgcc-1.8.2/build/uClibc/libc'
make[1]: *** [_dir_libc] Error 2
make[1]: Leaving directory `/cygdrive/c/down/m740av-xgcc-1.8.2/build/uClibc'
make: *** [build/uClibc/.m740av-xgcc_target_done] Error 2
Laut cygwin-setup ist gcc-core 3.4.4-1 installiert. Irgendwelche Ideen?
Lurch
27.03.2006, 16:09:24
Super Sache mit dem Makefile, leider läufts bei mir nicht durch: :mad:
In file included from regex.c:646:
regex.c: In function `byte_re_match_2_internal':
regex.c:7627: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[4]: *** [regex.o] Error 1
Laut cygwin-setup ist gcc-core 3.4.4-1 installiert. Irgendwelche Ideen? Hi,
seit einigen Monaten gibt's mit dem aktuellen Cygwin u.a. dieses Problem. Du musst Cygwin downgraden (das geht über's Cygwin Setup Utility), und zwar alles ausser den Paketen crypt und bash. Du musst den cross compiler im downgegradeten Cygwin laufen lassen, du darfst nicht upgraden.
Ich weiss wie das nervt, aber bislang hab ich mir noch nicht die Mühe gemacht die verantwortlichen Pakete zu isolieren..
Lurch
glotzi
28.03.2006, 10:14:41
Hi,
seit einigen Monaten gibt's mit dem aktuellen Cygwin u.a. dieses Problem. Du musst Cygwin downgraden (das geht über's Cygwin Setup Utility), und zwar alles ausser den Paketen crypt und bash. Du musst den cross compiler im downgegradeten Cygwin laufen lassen, du darfst nicht upgraden.
Ich weiss wie das nervt, aber bislang hab ich mir noch nicht die Mühe gemacht die verantwortlichen Pakete zu isolieren..
Lurch
Danke für die Info jetzt funzt der Kram. Ich denke, es wäre sinnvoll im README einen Hinweis zu haben.
glotzi
10.04.2006, 09:24:46
Does anyone tried to compile gdb with the toolchain?
It seems that configure and compilation are ok, but gdbserver and gdb produce a segmentation fault. :mad:
seit einigen Monaten gibt's mit dem aktuellen Cygwin u.a. dieses Problem. Du musst Cygwin downgraden (das geht über's Cygwin Setup Utility), und zwar alles ausser den Paketen crypt und bash. Du musst den cross compiler im downgegradeten Cygwin laufen lassen, du darfst nicht upgraden.
Ich weiss wie das nervt, aber bislang hab ich mir noch nicht die Mühe gemacht die verantwortlichen Pakete zu isolieren..Hallo Lurch, auf welche Version muss man denn downgraden?
Oder hat sich das Problem inzwischen erledigt?
Bis make libraries läuft alles, aber make test schlägt fehl:
$ make test
make -C test
make[1]: Entering directory `/home/xgcc/test'
mips-uclibc-gcc -Wall -O2 -static -Wl,-static -o helloworld_s helloworld.c
make[1]: mips-uclibc-gcc: Command not found
make[1]: *** [helloworld_s] Error 127
make[1]: Leaving directory `/home/xgcc/test'
make: *** [test] Error 2Woran kann das liegen?
Danke für Deine Hilfe!
Hi!
Just for the records: As can be expected, I originally had problems compiling this fine toolchain (Big Thanks to Lurch!) with gcc 4.0.2 as included in my SuSE Linux 10.0.
Find attached my patch which fixes these issues. It's all related to nowadays deprecated specifications of lvalues. The patch shouldn't break anything in older gcc's either, so I expect it could be safely included in your build system! Could you do that, Lurch?
Best regards,
eijk
Hi eijk,
since I am really not familiar with this tool chain and cross-compiling in general, could you please let me (very much Linux ignorant) know if my above mentioned problem may be fixed by your patch, and also how this patch has to be applied when using Cygwin?
A huge thank-you to you and Lurch for making it possible to develop things for our Box on our PCs/Apples or whatever! :)
@a.o.: No, I am sorry, I don't think my patch is related to your problem.
Could you check your PATH? Does it include /usr/local/mips-linux/bin? Did "make" install the compiler mips-uclibc-gcc to that location?
It's quite strange, because mips-uclibc-gcc must have been used before when you did "make libraries"...
eijk
PS. I am not sure if the paths are the same when using Cygwin...
Could you check your PATH? Does it include /usr/local/mips-linux/bin? Did "make" install the compiler mips-uclibc-gcc to that location?Is there a way to find that information in a log file?
Because the text feed during the "make" process is so overwhelming that I do not see a chance to checker whether there was a warning about a wrong path.
Of course I will check the path itself. Er, how do I do that?
Sorry for those silly questions, but I am really very new to this issue.
Your help is much appreciated.
Have a nice & sunny weekend! :)
Hi!
Try "echo $PATH". It should show a list of directories which are searched for executables.
If you want to save the output of make to a logfile, try
"make 2>&1 | tee make.log"
eijk
Lurch
05.05.2006, 15:58:12
Does anyone tried to compile gdb with the toolchain?
It seems that configure and compilation are ok, but gdbserver and gdb produce a segmentation fault. :mad: Hi glotzi, I've taken only a very quick look at gdb, and it doesn't look simple to me at all. I will not try it, sorry to say but I'm afraid you're on your own here.
Lurch
Lurch
05.05.2006, 16:24:24
Hallo Lurch, auf welche Version muss man denn downgraden?
Oder hat sich das Problem inzwischen erledigt? Hi agent orange, leider kann ich dir das auch nicht genau sagen. Das Problem ist dass Cygwin keinen einfachen Versionsstand kennt, daher kann ich dir auch keinen nennen. Einzig der Zeitraum, in dem Cygwin die fatale Änderung veröffentlicht hat, lässt sich auf ca. 4 Wochen einschränken, aber ich habe mir noch nicht die Mühe gemacht rauszufinden, welche Pakete in dieser Zeit aktualisiert wurden. Zusätzlich kann ich auch nicht zuverlässig sagen, welche Pakete downgegraded werden müssen, da mir das Package/die Packages nicht bekannt sind, die das Problem verusachen.
Bis make libraries läuft alles, aber make test schlägt fehl:
<snip>
Woran kann das liegen?
Danke für Deine Hilfe! Ich bin der selben Meinung wie eijk, dein PATH stimmt nicht. In der Datei INSTALL ist das auf Englisch dokumentiert, hier einfach nochmal auf Deutsch:
Es gibt zwei Mögichkeiten, den PATH anzupassen, entweder temporär (nur in der laufenden Cygwin Shell) oder ständig (in allen zukünftig geöffneten Cygwin Shells). Du willst letzteres, daher öffne einfach die Datei .bash_profile im Cygwin-Home-Verzeichnis <cygwin>\home\... in einem Texteditor und hänge folgende Zeile am Ende an:
PATH=${PATH}:/usr/local/mips-linux/bin
Speichern, schließen. In der nächsten Cygwin-Shell, die du öffnest, sollte dann alles funktionieren.
Um's zu testen gib einfach
mips-uclibc-gcc --version
ein, du solltest folgende Ausgabe kriegen:
mips-linux-gcc (GCC) 3.2.3
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Wenn der PATH nicht stimmt dann erhältst Du die Fehlermeldung bash: mips-uclibc-gcc: command not found.
Gruß,
Lurch.
Lurch
05.05.2006, 16:45:40
Hi!
Just for the records: As can be expected, I originally had problems compiling this fine toolchain (Big Thanks to Lurch!) with gcc 4.0.2 as included in my SuSE Linux 10.0.
Find attached my patch which fixes these issues. It's all related to nowadays deprecated specifications of lvalues. The patch shouldn't break anything in older gcc's either, so I expect it could be safely included in your build system! Could you do that, Lurch?
Best regards,
eijk Hello eijk,
thanks a lot for your contribution. I've read through the 2 issues that you've patched and they look ok to me, so I'll test it and if things turn out to be fine I'll include it in the next release.
Greets,
Lurch.
Danke Euch Beiden / Thanks to both of you! ;)
... Du willst letzteres, daher öffne einfach die Datei .bash_profile im Cygwin-Home-Verzeichnis <cygwin>\home\... in einem Texteditor und hänge folgende Zeile am Ende an:
PATH=${PATH}:/usr/local/mips-linux/binSpeichern, schließen. In der nächsten Cygwin-Shell, die du öffnest, sollte dann alles funktionieren.
Meine /home/user/.bash_profile sieht so aus - s. Anhang (musste ich zum Hochladen umbenennen).
Um's zu testen gib einfach
mips-uclibc-gcc --versionein, du solltest folgende Ausgabe kriegen:
user@PC ~
$ mips-uclibc-gcc --version
bash: mips-uclibc-gcc: command not foundDer Pfad stimmt also trotzdem nicht. Was mache ich denn da falsch?
By the way:
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/Programme/Windows Resource Kits/Tools/:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WIND
OWS/System32/Wbem:/cygdrive/c/Programme/WinSCP/:/cygdrive/c/Programme/OpenVPN/bin:/usr/local/mips-linux/binD.h., der Pfad ist doch da, aber er wird trotzdem nicht gefunden.
.
Tja, dann ist die Frage: Wo ist mips-uclibc-gcc denn dann? Such doch mal nach dieser Datei!
eijk
Sie liegt hier:
\home\xgcc\build\uClibc\extra\gcc-uClibc\mips-uclibc-gcc.exe
(gefunden über Windows Explorer, daher das .exe am Ende und die Backslashes)
Mittels find / -name 'mips-uclibc-gcc' direkt unter Cygwin kam leider auch nach langer Zeit (>10 Minuten) des Suchens nichts, so dass ich die Suche unter Cygwin abgebrochen habe.
Aber der o.g. Pfad ist schon ok und gilt ja unter Cygwin genauso, oder habe ich das Cygwin-Pfadkonzept total mißverstanden?
Achso, muss ich das auch hinter PATH wie oben eintragen (natürlich Slashes statt Backslahes), aber wie genau muss es dann lauten?
(sorry, falls es wirklich DAU-Fragen sind http://www.m740.de/forum/images/icons/icon11.gif )
Lurch
06.05.2006, 22:43:24
Sie liegt hier:
\home\xgcc\build\uClibc\extra\gcc-uClibc\mips-uclibc-gcc.exe
(gefunden über Windows Explorer, daher das .exe am Ende und die Backslashes) Hmm, das ist wirklich sehr merkwürdig; scheinbar wurde der cross-compiler zwar erzeugt, aber nicht richtig installiert - das ist umso merkwürdiger da er installiert sein muss, damit make libraries überhaupt laufen kann, und so wie ich dich verstanden hatte ging das ja glatt.
Ich schlage vor du machst nochmal einen make clean gefolgt von einem make. Kriegst Du ganz am Ende die Erfolgsmeldung ,,All done, succeeded building your M740 AV cross toolchain''? Wenn die nicht kommt dann gab's einen Fehler und der Build-Prozess wurde abgebrochen.
Mittels find / -name 'mips-uclibc-gcc' direkt unter Cygwin kam leider auch nach langer Zeit (>10 Minuten) des Suchens nichts, so dass ich die Suche unter Cygwin abgebrochen habe. Eigentlich sollte unter <cygwin>/usr/local/mips-linux/bin/ die ganze cross-toolchain liegen, so 50-60 Programme und Verknüpfungen, darunter mips-linux-gcc.exe. Kannst Du da was finden?
Lurch.
tb2000
20.08.2006, 16:34:31
Bin neu hier und würde gerne meine 750 auf cygwin neu builden um als root reinzukommen; da der thread hier im May aufhöhrt dachte ich, ich frag mal nach ob es was Neues gibt - vor Allem bzgl. der Probleme mit dem letzten Stand von Cygwin?
Thanx
tb
Lurch
28.05.2007, 12:57:33
Bin neu hier und würde gerne meine 750 auf cygwin neu builden um als root reinzukommen; da der thread hier im May aufhöhrt dachte ich, ich frag mal nach ob es was Neues gibt - vor Allem bzgl. der Probleme mit dem letzten Stand von Cygwin?
Thanx
tb
Hab nie rausgefunden, was da Ende 2005 in Cygwin so fatales geändert wurde. Bin kürzlich auf die Cygwin Time Machine (http://www.fruitbat.org/Cygwin/#cygwintimemachine) hingewiesen worden, vielleicht ist's damit ja wieder hinzukriegen (hab's wegen mangelndem Interesse noch nicht ausprobiert).
Würde dennoch empfehlen, mit Linux bzw. coLinux (http://www.colinux.org/) zu arbeiten.
Grüße,
Lurch.
johnny
28.05.2007, 13:48:19
Bin neu hier und würde gerne meine 750 auf cygwin neu builden um als root reinzukommen;Was willst Du denn genau? Wenn Du "nur" telnet freischalten willst, um als root von außen zuzugreifen, wird Dich cygwin nicht viel weiterbringen (IIRC).
Sowas kann man aber prima mit einer Linux Live-CD machen.
Ciao
Johnny
Powered by vBulletin® Version 4.1.9 Copyright ©2012 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.