07-14-2012, 03:12 PM | #76 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Continued from: https://www.mobileread.com/forums/sho...1&postcount=73 Now that you have a working, emulated native, arm build environment ... And you have just built a copy of tcc v-0.9.26 dynamically linked against uClibc ... How do you get a static linked tcc out of this when the ./configure and make sequence does not observe the standard --static --static-libgcc sequence? Thought no one would ask. Look at the gcc link commands output during the build, in this case there is only one of them of any significance, the final linking: Code:
gcc -o tcc tcc.o libtcc.a -lm -ldl Code:
(armv6l:1) /home/tinycc # gcc --static --static-libgcc -o tcc-static tcc.o libtcc.a -lm -ldl (armv6l:1) /home/tinycc # ldd tcc-static not a dynamic executable (armv6l:1) /home/tinycc # strip --strip-unneeded tcc-static (The -run option causes this tcc-static to hang, it would take a bit of further tweaking to make -run work while libdl was statically linked). Check it: Code:
(armv6l:1) /home # ./tcc-static -o hello hello.c (armv6l:1) /home # ./hello Hello World Edit: What some users probably need is a build of this with SYSROOT=/mnt/us included in the configure; maybe even add /mnt/us/lib and /mnt/us/include into the tcc-static search paths. But those are documented options in the ./configure --help file and now anyone can do it with these two posts. Last edited by knc1; 07-15-2012 at 05:04 AM. |
|
07-14-2012, 04:38 PM | #77 |
( ͡° ͜ʖ ͡°){ʇ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
|
Excellent. The entire day I spent last week shuffling 80Gb of trash about all seems worth it now.
I shall fill this space with your wondrous toys. Much appreciated! Last edited by twobob; 07-14-2012 at 04:41 PM. |
07-14-2012, 05:23 PM | #78 | |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
Regarding changing SYSROOT -- I built some programs (including SDL for eink) that look for libs in /mnt/us/lib. Nice to not have to futz with environment vars, and don't need symlinks on root. Instead of symlinks in /mnt/us/lib, I just have copies of a lib for each name needed (plenty of space there). This behavior would definately be a plus for tcc. Last edited by geekmaster; 07-14-2012 at 07:25 PM. |
|
07-14-2012, 06:04 PM | #79 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
My objective was just a "getting started" sort of procedure. Following the procedure with just changes to the ./configure command would be a good follow-up for someone (else). - - - - Myself, I prefer using /mnt/us as a substitute for /usr/local in the FHS plan. Hmm... I probably should have include an example usage of DESTDIR ... Ah, well, that can be a "student exercise" also. My build of qemu-1.1.1 has an example of using DESTDIR, see: https://www.mobileread.com/forums/sho...3&postcount=85 Last edited by knc1; 07-15-2012 at 12:51 PM. |
|
07-15-2012, 04:19 AM | #80 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
The qemu emulator has a selection of (at least) three sound cards with alsa and oss interfaces. http://alien.slackbook.org/dokuwiki/...slackware:qemu I don't know how out-of-date that wiki page might be, but it is rare for hardware emulation to be removed from qemu once someone writes it. The main qemu web site would have the final word. http://wiki.qemu.org/Qemu-doc.html The start-up command is in: ./run-emulator.sh (and dev-environment.sh just sources it) That would be the place to tweak any qemu options needed to get sound out of your (emulated) build environment. Plus, only /home is writable in Rob Landley's setup, so using a --prefix=/home when building software will be required. The DESTDIR= variable is recognized by some makefiles and can be of use at times also. * * * * I have attached the dynamically linked tcc for your emulation environment to this post. Just in case you haven't built it yet from my earlier posts. Notes: This one is built against uClibc - it will not run on the kindles, they don't have uClibc system libraries installed. This one does have a usable -run option. Which shortens the turn-around time a lot for testing small code snippets. The obvious advantage here is, make a programming error and the worst you might have to do is cancel the terminal instance you are running the qemu instance from - then it all goes away. Don't scoff at this development environment - on your mutli-core studio machine it is probably as fast as the K3. Last edited by knc1; 07-15-2012 at 05:24 AM. |
|
07-15-2012, 04:25 AM | #81 | |
( ͡° ͜ʖ ͡°){ʇ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:
Thanks for the permissions and flags tips! |
|
07-15-2012, 04:46 AM | #82 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
07-15-2012, 05:33 AM | #83 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
And for those more interested in system's level programming ...
http://www.elinux.org/Virtual_Development_Board Adapt as required (Rob's emulation environment is already the ARM versatile-pb, and an eariler post in this thread installed the CS/MG tool-chain). RSN, someone is going to be booting the K3's Amazon kernel, and then build a good strace. Someday. Don't anyone wait for me to do it. |
07-15-2012, 08:55 AM | #84 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
qemu-system-arm -audio-help qemu-system-arm -help And the Landley emulator scripts recognize two environment variables: KERNEL_EXTRA QEMU_EXTRA The dev-environment.sh script trashes those values for its own use. So we may want to re-write that run-environment script to take additional options as variables. Which could include fixing up this hard coded cpu setting. The cpu type, -cpu arm1136-r2 is hard coded. And since cat /proc/cpuinfo shows too many features, probably one of these would be a closer match: qemu-system-arm -cpu ? Neither that, nor qemu-system-arm -M ? has anything at all to say about FreeScale boards/parts. We may have to futz with that script's start-up command line a bit before you start using the hardware DSP / vector instructions. Last edited by knc1; 07-15-2012 at 06:23 PM. |
|
07-15-2012, 11:58 AM | #85 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
QEMU-1.1.1
I foresee difficulties here, with each developer using what their Linux distribution **thinks** they should have (usually qemu-kvm, not qemu).
Let us see if we can out-smart the distribution planners ... How I built the current release: Spoiler:
Download the attached tar-ball. Installation: core2quad ~ $ sudo tar -C /opt --extract --file=qemu-1.1.1-arm.tar.gz core2quad ~ $ /opt/qemu111/bin/qemu-system-arm --version QEMU emulator version 1.1.1, Copyright (c) 2003-2008 Fabrice Bellard To activate: core2quad ~ $ export PATH=/opt/qemu111/bin:$PATH core2quad ~ $ qemu-system-arm --help - - - lots of output snipped away - - - Test run: Spoiler:
NOTE: If your host filesystem does not have a /dev/dsp device: sudo mknod /dev/dsp c 14 3 But since most /dev file trees are now on tmpfs, this will go away with the next reboot. It will probably vary from distribution to distribution how best to make this device always present. For now, left as a: "student exercise". I would like to hear some feedback from others on this build, but it ran well enough for me to create the following static linked applications. Only: IWFM isn't strong enough to be publicizing it yet. Last edited by knc1; 07-16-2012 at 07:04 AM. |
07-15-2012, 02:26 PM | #86 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
XZ Utils-5.0.4-static (and LZMA)
I started out to build a current version of strace, but that comes as an xz compressed archive.
Duh... http://tukaani.org/xz/ So build XZ Utils first: Spoiler:
As you can see in the build notes above, this is the entire distribution (including documentation). And the tar-ball has a leading directory path of mnt/us ... (as a reminder of where they should probably end up - but these are all static, so user's choice) You will probably want to open up the tar ball and select from: Code:
mnt/us/bin/ mnt/us/bin/xz mnt/us/bin/lzfgrep mnt/us/bin/xzdiff mnt/us/bin/lzmadec mnt/us/bin/lzcat mnt/us/bin/unxz mnt/us/bin/lzdiff mnt/us/bin/lzma mnt/us/bin/unlzma mnt/us/bin/xzcat mnt/us/bin/xzfgrep mnt/us/bin/lzcmp mnt/us/bin/xzgrep mnt/us/bin/lzless mnt/us/bin/xzegrep mnt/us/bin/xzcmp mnt/us/bin/lzmore mnt/us/bin/lzgrep mnt/us/bin/xzmore mnt/us/bin/xzless mnt/us/bin/lzegrep mnt/us/bin/xzdec mnt/us/bin/lzmainfo Note: Some of those are scripts, you'll see that when you get the tar-ball opened onto your filesystem. Edit: After a bit of study, you probably only need mnt/us/bin/xz because it evidently auto-detects lzma I have attached it (xz) gzip'd, just gunzip it. Edit: The applications inside of the complete tar-ball do not have their symbols stripped. The individual .gz'd file does have the excess symbols stripped. Four or five people got copies of the "too big" staticly linked executables. Last edited by knc1; 07-15-2012 at 08:54 PM. |
07-15-2012, 04:13 PM | #87 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Strace 4.7 static
This one is the current release of strace.
I did not patch in the Amazon/lab126 syscalls. I did not build it to decode the new AIO calls. Other than that, it should "just work". First, install the just created xz in the emulator's /home/bin directory and put the new bin directory on the path: Spoiler:
The build notes: Spoiler:
The complete tar-ball contents: Code:
(armv6l:1) /home/strace47 # tar -tf strace-4.7-static-arm.tar.gz mnt/ mnt/us/ mnt/us/share/ mnt/us/share/man/ mnt/us/share/man/man1/ mnt/us/share/man/man1/strace.1 mnt/us/bin/ mnt/us/bin/strace-log-merge mnt/us/bin/strace mnt/us/bin/strace-graph Edit: The applications inside of the complete tar-ball do not have their symbols stripped. The individual .gz'd file does have the excess symbols stripped. Four or five people got copies of the "too big" staticly linked executables. Last edited by knc1; 07-15-2012 at 08:54 PM. |
07-15-2012, 08:57 PM | #88 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Edit: For xz.gz and strace.gz
The applications inside of the complete tar-ball do not have their symbols stripped. The individual .gz'd file does have the excess symbols stripped. Four or five people got copies of the "too big" staticly linked executables. The stripped versions are about half the original posting's size if you wish to re-download them. Sorry about the posting error folks. |
07-15-2012, 10:33 PM | #89 |
( ͡° ͜ʖ ͡°){ʇ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
|
I've got some serious homework now. Need to book a week off to get my system up to code.
Thanks for your tireless efforts on this forum. The stripped versions are about half the original posting's size if you wish to re-download them. Done, cheers Last edited by twobob; 07-15-2012 at 10:35 PM. Reason: added that I grabbed the goodies again |
07-16-2012, 07:37 AM | #90 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
I updated the lead post with some words about the post attachments.
|
|
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 |