07-13-2012, 12:07 PM | #61 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
I assume from the filename this is a C not a C++ source, so ...
--static --static-libgcc Ref: http://gcc.gnu.org/onlinedocs/gcc-4....l#Link-Options That will take care of the warning messages about the runtime (if CS built a static libgcc - I haven't checked for that). GM's choice of 2010q1-202 (a CS product, prior to purchase by MG) is one very close to what lab126 was using on the K5. "We stock" the 2010-09 for that purpose, one (six months later) release. Shouldn't be much difference between the two. For "new work" such as this, using the most recent release (2012.03-57) is the way to go. You shouldn't run into the corner cases where you need to match the original compiler version. Some of the work GM does, does run into them and does require a "best match" of the tool chain. While cross compiling, try setting your PATH to: export PATH=/home/simon/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin:$PATH Then: gcc --version should report the arm gcc (and also make all references to the tool chain components grab the arm components). I can't see how, when you enter: arm-linux-gcc that you are picking up the compiler that is being reported in the messages. There must be some other local settings that you have that make it do that. Check those, or post them for review here. |
07-13-2012, 12:12 PM | #62 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Issue resolved assuming SHARED is acceptable
Quote:
I have managed to convince it to build shared for now. Since "standalone" static binaries aren't truly static anyways (IMHO), and we have a known platform I think I will stick to shared - on the understanding that shared builds continue to work across all platforms - which they should now. I recompiled alsa with your settings and building shared doesn't give me any errors anymore. So I will go with that. |
|
07-13-2012, 12:16 PM | #63 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
hmm yes
Quote:
The error only exhibits when sing the alsalib and only when used static. Since I am happy with shared I will file this under - weird - and move on. Thanks v much! |
|
07-13-2012, 12:25 PM | #64 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Plus, sometimes you have to: --static --static-libgcc --disable-shared when building against glibc. (That, for instance, will make Busybox happy.) The other common "C" libraries (uClibc, eglibc, newlib) are more suited for building static and deal with this another way. |
|
07-13-2012, 12:38 PM | #65 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
If you browse the tool-chain tree, you will find "gcc" in two places ... One, under an "ARCH qualified path / bin" One, where the "ARCH qualifier" is part of the "gcc" file name. You want the full, absolute, path to the "ARCH qualified path / bin" first in your path search order. Listing the contents of that "ARCH qualified path / bin" will show just how many components are included in the tool-chain. Ah, another bit of related trivia: the application "gcc" is not the compiler. It is the command line option processor "front end" to the tool-chain. It in turn munges the options and calls the various other components in that "ARCH qualified path / bin" to get the various parts of the compile done. At which point the tool-chain behavior usually turns into crap when its intial access was via a (shortened) symbolic link. Last edited by knc1; 07-13-2012 at 12:46 PM. |
|
07-13-2012, 02:33 PM | #66 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Quote:
Rightyo then, I will do a tidyup before I try any statically charged builds and call from the fully qualified name for now then! Thanks knc1 |
|
07-13-2012, 03:29 PM | #67 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
gcc ar ld etc, etc, etc is all you have to call. This will fix most, simple "makefiles" - for Autotools stuff you need sb2 also. Let me see now, I haven't done it, so I'll do it right now and make a follow up post. Last edited by knc1; 07-13-2012 at 03:31 PM. |
|
07-13-2012, 03:56 PM | #68 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Oops.
One very bad idea deleted here. Works for simple builds but breaks makefiles that need to access both host and target tools. Instead of this post, follow the directions bundled with the x-compiler(s). Last edited by knc1; 12-15-2012 at 04:51 PM. |
07-13-2012, 04:41 PM | #69 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
@Knc1
You hero. much appreciated!! Last edited by twobob; 12-15-2012 at 04:54 PM. |
07-13-2012, 05:11 PM | #70 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Not yet - give it some tries with the more difficult to build things.
If you find a difference between calling by the short name and the long name - then we will have to out-smart it some other way. At least all changes to the file system (other than the PATH modification) are in one directory. Un-install: rm -fr /opt/arm-2012.03 And fix the PATH modification statement if you used it. |
07-13-2012, 05:24 PM | #71 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Quote:
|
|
07-14-2012, 09:19 AM | #72 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Since you have your notebook out now ...
For handwritten, off-the-wall, makefiles - - Nothing replaces reading the author's work and if they don't use the commonly accepted build variables in commonly accepted ways, trying to "get inside their head" to cross-compile their work. For autotools based sources (./configure, make, make install) you will need sb2 to cross-compile, or any of the various "native mode" tools because configure will insist on creating the output files based on what it finds on the host rather than the target. Cmake based sources - I don't have a lot of experience with those, from what I read they **should** cross-compile but rarely do. And then you run into things like: http://www.creytiv.com/baresip.html Two library sets, a demo program and a client program. Lots of good things in those library sets (A/V codecs, low level bit and byte bashing, etc.) which might be of use to various projects here. Step one of cross-compiling anything: read the Makefile (with capital M). Your next move will be based on what you find there. re-0.4.1:Makefile First impression - cross-compiling other than from mingw32 to linux will be a lot of fun. It might be quicker to do this one as an "emulated native" build under Aboriginal Linux http://landley.net/aboriginal/about.html See the following post for a quick tour of building a static application using Rob Landley's Aboriginal Linux. Last edited by knc1; 07-14-2012 at 11:59 AM. |
07-14-2012, 11:43 AM | #73 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Emulated native environment for STATIC built programs.
This environment can only build STATIC linked programs to run on the Kindles!
But since building STATIC linked programs seems to be a common speed-bump ... It will build dynamically linked programs, but for uClibc, which is not what the Kindles are using. * * * * Presumes a QEMU that provides: qemu-system-arm is already installed. Confer with your Linux package manager about that subject. and/or Give my hand-built one a try, attached to post: https://www.mobileread.com/forums/sho...3&postcount=85 and provide feedback on your results. Make a work place and grab the tar-ball: Code:
core2quad ~ $ mkdir BLDS core2quad ~ $ cd BLDS core2quad BLDS $ wget http://drpbox.knetconnect.com/KeK/system-image-armv6l.tar.bz2 Code:
core2quad BLDS $ tar --extract --file=system-image-armv6l.tar.bz2 core2quad BLDS $ cd system-image-armv6l Code:
core2quad system-image-armv6l $ ./run-emulator.sh qemu-system-arm: pci_add_option_rom: failed to find romfile "pxe-rtl8139.rom" Uncompressing Linux... done, booting the kernel. Booting Linux on physical CPU 0 * * * * VFS: Mounted root (squashfs filesystem) readonly on device 8:0. Freeing init memory: 100K 8139cp 0000:00:0c.0: eth0: link up, 100Mbps, full-duplex, lpa 0x05E1 Not using distcc. Type exit when done. (armv6l:1) /home # gcc -dumpmachine armv6l-unknown-linux-gnueabi (armv6l:1) /home # uname -a Linux (none) 3.4.0 #1 Sat Jul 14 08:57:51 CDT 2012 armv6l GNU/Linux (armv6l:1) /home # exit Restarting system. core2quad system-image-armv6l $ The above, default, system image only has a 32Mbyte /home directory. For development, you want a larger /home directory. If you execute ./dev-environment.sh without setting any environment varables it will create a 2Gbyte /home directory file for you. You can always use the ./dev-environment.sh script for entry, it will not over-write any existing hdb.img. How do you get your files in and out of the emulated arm system? Read and follow the comments in ./native-build.sh; OR Just mount the hdb.img (the /home when inside the emulated system) and copy to and fro as required. Code:
core2quad system-image-armv6l $ sudo mkdir /mnt/hdb core2quad system-image-armv6l $ sudo mount -o loop hdb.img /mnt/hdb - - - copy, copy, modify, copy - - - core2quad system-image-armv6l $ sudo umount /mnt/hdb Just 'wget' your sources while inside the environment, for an example tinycc (which defaults to building as dynamicly linked - at least this one does): Code:
core2quad system-image-armv6l $ ./dev-environment.sh * * * * Type exit when done. (armv6l:1) /home # wget http://drpbox.knetconnect.com/KeK/tinycc-patched.tgz (armv6l:1) /home # tar -xf tinycc-patched.tgz (armv6l:1) /home # cd tinycc (armv6l:1) /home/tinycc # (edit configure cpu list to include armv6l) (armv6l:1) /home/tinycc # ./configure (armv6l:1) /home/tinycc # make (which will fail when it tries to build documentation, so what?) (armv6l:1) /home/tinycc # ./tcc -v tcc version 0.9.25 (which by the way, is a lie -- this is the not yet released 0.9.26) This copy of tinycc will also "build static" executables. It will build "shared library" executables for uClibc (its own environment) It might be possible to build "shared library" executables with it for a glibc environment also - provided you get all the system library over-ride commands required correct on your tcc command line. Something always needs to be left as a: "student exercise" As in: what became of /usr/include/stddef.h ? Continued at post: https://www.mobileread.com/forums/sho...7&postcount=76 Where the final tcc-static is built. Last edited by knc1; 07-15-2012 at 12:24 PM. |
07-14-2012, 01:10 PM | #74 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
False alarm. I had included <stdio.h> in my HelloWorld.c file when I did not need to.
Source: Code:
main() { printf("Hello World\n"); } Code:
(armv6l:1) /home # ./tcc -run hello.c Hello World Last edited by knc1; 07-14-2012 at 01:49 PM. |
07-14-2012, 02:54 PM | #75 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
insert brain here
Brain hurt.
Need two lifetimes to catch up with your headspace. *goes and gets second lifetime* This information is golddust. thanks mate |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Accessories DIY KT Case | echo013 | Amazon Kindle | 2 | 01-27-2012 06:53 PM |
DIY Stylus | scottjl | Apple Devices | 3 | 05-10-2010 01:52 AM |
DIY Scanner | Eratosthenes | News | 14 | 04-16-2010 04:21 PM |
DIY Idea | sřrensundsans | Sony Reader | 6 | 01-26-2010 01:25 AM |
DIY stylus | -Thomas- | iRex | 5 | 02-12-2009 12:05 PM |