Active Topics

 


Reply
Thread Tools
Posts: 14 | Thanked: 36 times | Joined on Dec 2009 @ Adelaide, Australia
#1
I've recently dusted off my N800 which had been sitting idle for several years. I want to write a new program for it, but having recently learned C++11, I don't want to have to work with the older C++ standard if I can avoid it.

So I've packaged up a GCC 4.9 (and modern binutils) cross compiler toolchain.

If anyone else is interested in this, you can grab the diablo-gcc-4.9 package from http://www.users.on.net/~toojays/mae...opment/wheezy/. It's compiled for Debian 7 / amd64, so should work on Ubuntu systems as well. The source package is there as well, so can be easily rebuilt for other Debian-based systems if needed.

More details (copied from the README.Debian which is installed by the package):

This package contains updated C and C++ cross-compilers for Maemo 4.1
(Diablo). These install under /opt/diablo-gcc-4.9. They are configured for
maximum compatibility with the original Diablo toolchain.

The intent is that binaries produced using this toolchain can be installed on a
Diablo system with no additional dependencies. This is largely achieved by
replacing libgcc_s.so and libstdc++.so with linker scripts which cause the
desired symbols to be looked for first in the original (i.e. GCC 3.4) versions
of those libraries. If the desired symbols are not found there, they are linked
statically.

The debug version of libstdc++.so does not use the same linker script trick,
since it seemed like that would be more confusing than useful. If you want to
link against this library, add "-L
/opt/diablo-gcc-4.9/arm-none-linux-gnueabi/lib/debug/" to your g++ link command
line, and ensure that library is accessible when running the compiled program.

There are some ABI compatibility corner cases (see
<http://gcc.gnu.org/wiki/Cxx11AbiCompatibility>) to be aware of if mixing
objects compiled for C++11 and C++98, but most things should just work. I was
able to build a simple gtkmm application using C++11, and run it against the
gtkmm libraries from diablo extras with no problem.
 

The Following 8 Users Say Thank You to toojays For This Useful Post:
Posts: 1 | Thanked: 2 times | Joined on May 2014
#2
Thank you, would you be interested in making classic gcc-4.9 package similiar to this one?

I think that LTO optimalization made in 4.9 could be also very useful for N900

At this moment I've been able to test it only on x86_64, where it saved about 5-20% of binary size.
 

The Following 2 Users Say Thank You to okias For This Useful Post:
Posts: 42 | Thanked: 40 times | Joined on Jan 2015 @ Italy
#3
hello, i'm pretty new to maemo and cross-compiling for it, and i can't figure out how to use this toolchain

i added /opt/diablo-gcc-4.9/bin and /opt/diablo-gcc-4.9/arm-none-linux-gnueabi/bin to my $PATH, but when i try compiling i get

Code:
 /opt/diablo-gcc-4.9/lib/gcc/arm-none-linux-gnueabi/4.9.0/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/libgcc_s.so.1
collect2: error: ld returned 1 exit status
do i have to link by hand everything? am i missing something?
 

The Following User Says Thank You to u7knv9h For This Useful Post:
endsormeans's Avatar
Posts: 3,141 | Thanked: 8,161 times | Joined on Feb 2013 @ From my Gabriola Island hermitage, near the Edge of the World
#4
it just occurred to me...
considering the wiki for n8x0 and scratch is outdated, instructions don't work properly anymore ...etc. and even when they did it was a royal pain.
Could someone tinker with the wiki there and amend it to date so it isn't a hairpulling experience ?...Instead of the scratchbox attemptee ending in a pavement stain from ledge-jumping from 37 stories ....
I mean..hell...I like puzzles... I like challenges...but...I don't enjoy going near the mess anymore...
hrm...
anyway..
just a thought...
but considering the op has managed a new toolchain that can be used with debian 7 amd64...
for absolute simplicity ..
for new and old members alike..
would it be possible to create a debian 7 distro which has scratch already plumbed ready for n8x0's ..n900 even?
Is it reasonably feasible?....
is it far far too much work for it to be rationally doable? ..
is it impossible? (since I have not undertaken such a feat I would not know...)
I do know they had a knoppix distro way back in the day ...fire it up away you went...I'm not sure if they had a whole team working on it nor how long it took.
__________________
Lurker since 2007, Member since 2013, Certifiable since 1972

Owner of :
1-n770 (in retirement), 3-n800's / 3-n810's (still in daily use), 5-n900's ((3 are flawless, 1 loose usb ( parts), 1 has no telephony (parts))
3-nexus 5's : 1 w/ Floko Pie 9.1 (running beautifully) waiting for Stable Droid 10 rom, 1 w/ ̶Ubuntu Touch, 1 with Maru OS (intend maemo leste when ready)

1/2 - neo900 pre- "purchased" in 2013. N̶o̶w̶ ̶A̶w̶a̶i̶t̶i̶n̶g̶ ̶r̶e̶f̶u̶n̶d̶ ̶p̶r̶o̶c̶e̶s̶s̶ ̶l̶a̶s̶t̶ ̶f̶e̶w̶ ̶y̶e̶a̶r̶s̶ - neo900 start up declared officially dead -
Lost invested funds.


PIMP MY N8X0 (Idiot's Guide and a video walkthrough)http://talk.maemo.org/showthread.php?t=94294
THE LOST GRONMAYER CATALOGShttp://talk.maemo.org/showthread.php...ight=gronmayer
N8X0 VIDEO ENCODING THE EASY WAYhttp://talk.maemo.org/showthread.php...ght=mediacoder
242gb ON N800http://talk.maemo.org/showthread.php?t=90634
THE PAIN-FREE MAEMO DEVELOPMENT LIVE DISTRO-ISO FOR THE NOOB TO THE PROhttp://talk.maemo.org/showthread.php?t=95567
AFFORDABLE MASS PRODUCTION FOR MAEMO PARTShttp://talk.maemo.org/showthread.php?t=93325

Meateo balloons now available @ Dave999's Meateo Emporium
 

The Following User Says Thank You to endsormeans For This Useful Post:
Posts: 14 | Thanked: 36 times | Joined on Dec 2009 @ Adelaide, Australia
#5
Originally Posted by u7knv9h View Post
hello, i'm pretty new to maemo and cross-compiling for it, and i can't figure out how to use this toolchain

i added /opt/diablo-gcc-4.9/bin and /opt/diablo-gcc-4.9/arm-none-linux-gnueabi/bin to my $PATH, but when i try compiling i get

Code:
 /opt/diablo-gcc-4.9/lib/gcc/arm-none-linux-gnueabi/4.9.0/../../../../arm-none-linux-gnueabi/bin/ld: cannot find /lib/libgcc_s.so.1
collect2: error: ld returned 1 exit status
do i have to link by hand everything? am i missing something?
I think you are the first user of toolchain besides me, and so this is the first bug report. I reckon it will work for you if you make the following changes to the linker script:

Code:
diff -ur /tmp/diablo-gcc-4.9-orig/arm-none-linux-gnueabi/lib/libgcc_s.so.1 /opt/diablo-gcc-4.9/arm-none-linux-gnueabi/lib/libgcc_s.so.1
--- /tmp/diablo-gcc-4.9-orig/arm-none-linux-gnueabi/lib/libgcc_s.so.1	2014-04-30 07:43:47.000000000 +0930
+++ /opt/diablo-gcc-4.9/arm-none-linux-gnueabi/lib/libgcc_s.so.1	2015-04-03 10:00:17.227741457 +1030
@@ -3,4 +3,4 @@
  * which would occur if we just statically linked against the new libgcc_s, and
  * saves us having to worry about depending on a new shared library.
  */
-INPUT( /lib/libgcc_s.so.1 -lgcc )
+INPUT( /opt/diablo-gcc-4.9/maemo-sdk-rootstrap_4.1.2_armel/lib/libgcc_s.so.1 -lgcc )
diff -ur /tmp/diablo-gcc-4.9-orig/arm-none-linux-gnueabi/lib/libstdc++.so /opt/diablo-gcc-4.9/arm-none-linux-gnueabi/lib/libstdc++.so
--- /tmp/diablo-gcc-4.9-orig/arm-none-linux-gnueabi/lib/libstdc++.so	2014-04-30 07:43:47.000000000 +0930
+++ /opt/diablo-gcc-4.9/arm-none-linux-gnueabi/lib/libstdc++.so	2015-04-03 10:00:02.379767105 +1030
@@ -3,4 +3,4 @@
  * which would occur if we just statically linked against the new libstdc++, and
  * saves us having to worry about depending on a new shared library.
  */
-INPUT( /usr/lib/libstdc++.so.6 libstdc++.a )
+INPUT( /opt/diablo-gcc-4.9/maemo-sdk-rootstrap_4.1.2_armel/usr/lib/libstdc++.so.6 libstdc++.a )
I didn't need this at the time I was using this compiler because I was using it within a chroot.

Let me know if this helps.
 

The Following 2 Users Say Thank You to toojays For This Useful Post:
Posts: 14 | Thanked: 36 times | Joined on Dec 2009 @ Adelaide, Australia
#6
Originally Posted by endsormeans View Post
would it be possible to create a debian 7 distro which has scratch already plumbed ready for n8x0's ..n900 even?
Is it reasonably feasible?....
is it far far too much work for it to be rationally doable? ..
is it impossible?
It's probably possible, but in terms of the amount of time required in relation to the payoff, most of us are better off just running scratchbox in an old distro on a VM. E.g.
Silvio's vagrant setup
worked for me last time I dabbled with N900 development.

I have tried a few times to come up with a new development environment which doesn't require scratchbox. Typically using a chroot with the N800/N900 rootstrap, using qemu, and patching in native amd64 binaries for things where extra performance is needed (e.g. compiler, gzip, etc). Following similar principles as described at https://mariusv.wordpress.com/2008/1...a-pot-of-gold/ , but without scratchbox at all. I never managed to get as far as bringing up X in such an environment. The scripts which start the GUI on maemo have special code which causes it to behave differently under scratchbox which lets this work. IIRC, they do something different not just with X, but also with dbus, which I never unraveled. Additionally, on modern Debian, the Xephyr display server isn't compatible with maemo's X libraries.

If I were to start building a development environment for maemo today, I'd forget about emulation, and just focus on cross-compiling. Obviously I have already taken a step in that direction. The trouble is, once you go down this road, it becomes impossible to take advantage of existing (unchanged) development packages from the maemo repositories, because many of them were built with scratchbox in mind. IIRC, the Qt moc is one example of this.

Continuing on this thought, suppose we had a cross compiler, and corresponding library development packages for a GUI toolkit (I like gtkmm on Diablo, qt on Fremantle). Using the same versions and build flags as used by the real maemo libs, so anything built with this toolchain could be installed on maemo with no additional dependencies.

Hmm, I reckon you'd also want a way to create Diablo/Fremantle compatible debs, which would be another challenge.

Would that make life easier for anyone here? Or just add another confusing development option?
 

The Following User Says Thank You to toojays For This Useful Post:
endsormeans's Avatar
Posts: 3,141 | Thanked: 8,161 times | Joined on Feb 2013 @ From my Gabriola Island hermitage, near the Edge of the World
#7
yea I understand the compat issue with Xephyr ...
and boy o ...that is really really too bad the scratchbox-less build enviro was brick-walled. Hm...

And...when you said .."Continuing on this thought, suppose we had a cross compiler, and corresponding library development packages for a GUI toolkit (I like gtkmm on Diablo, qt on Fremantle). Using the same versions and build flags as used by the real maemo libs, so anything built with this toolchain could be installed on maemo with no additional dependencies...."
Hell I'm partial to that ..

and lastly ..."Hmm, I reckon you'd also want a way to create Diablo/Fremantle compatible debs, which would be another challenge."
yea ... hm..well for the time being at least..considering that fremantle has plenty of hands in the pot over all the n900debian, fptf, etc...I think there are enough brains pointed at those probs without adding to them immediately...not to mention..there aren't alot of current brains focusing on the n8x0 line...fact is...for a long time there hasn't been....the last couple months it's been pretty much just you and Kotczarny that have been doing the pioneering for the n8x0.
in the long haul it would be advantageous to have 1 cohesive method across platforms..but right now with all the n900 projects going on I think ..it better to wait on that idea. But for goodness sake don't you dare stop on the n8x0's!
__________________
Lurker since 2007, Member since 2013, Certifiable since 1972

Owner of :
1-n770 (in retirement), 3-n800's / 3-n810's (still in daily use), 5-n900's ((3 are flawless, 1 loose usb ( parts), 1 has no telephony (parts))
3-nexus 5's : 1 w/ Floko Pie 9.1 (running beautifully) waiting for Stable Droid 10 rom, 1 w/ ̶Ubuntu Touch, 1 with Maru OS (intend maemo leste when ready)

1/2 - neo900 pre- "purchased" in 2013. N̶o̶w̶ ̶A̶w̶a̶i̶t̶i̶n̶g̶ ̶r̶e̶f̶u̶n̶d̶ ̶p̶r̶o̶c̶e̶s̶s̶ ̶l̶a̶s̶t̶ ̶f̶e̶w̶ ̶y̶e̶a̶r̶s̶ - neo900 start up declared officially dead -
Lost invested funds.


PIMP MY N8X0 (Idiot's Guide and a video walkthrough)http://talk.maemo.org/showthread.php?t=94294
THE LOST GRONMAYER CATALOGShttp://talk.maemo.org/showthread.php...ight=gronmayer
N8X0 VIDEO ENCODING THE EASY WAYhttp://talk.maemo.org/showthread.php...ght=mediacoder
242gb ON N800http://talk.maemo.org/showthread.php?t=90634
THE PAIN-FREE MAEMO DEVELOPMENT LIVE DISTRO-ISO FOR THE NOOB TO THE PROhttp://talk.maemo.org/showthread.php?t=95567
AFFORDABLE MASS PRODUCTION FOR MAEMO PARTShttp://talk.maemo.org/showthread.php?t=93325

Meateo balloons now available @ Dave999's Meateo Emporium
 
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#8
Scratchbox still works great on Gentoo and is easy to setup. Getting Gentoo itself installed will be your biggest hurdle as it doesn't have an installer. But the process is just like installing Maemo on an SD card, typing a bunch of commands.
 

The Following User Says Thank You to auouymous For This Useful Post:
Posts: 14 | Thanked: 36 times | Joined on Dec 2009 @ Adelaide, Australia
#9
Originally Posted by endsormeans View Post
and lastly ..."Hmm, I reckon you'd also want a way to create Diablo/Fremantle compatible debs, which would be another challenge."
yea ... hm..well for the time being at least..considering that fremantle has plenty of hands in the pot over all the n900debian, fptf, etc...I think there are enough brains pointed at those probs without adding to them immediately...not to mention..there aren't alot of current brains focusing on the n8x0 line...fact is...for a long time there hasn't been....the last couple months it's been pretty much just you and Kotczarny that have been doing the pioneering for the n8x0.
in the long haul it would be advantageous to have 1 cohesive method across platforms..but right now with all the n900 projects going on I think ..it better to wait on that idea. But for goodness sake don't you dare stop on the n8x0's!
I think I was misunderstood here. I didn't mean making a single package that would run on both Diablo and Fremantle. I was just talking about being able to build a deb on a modern system which will install on those older distros. I suspect that requires forward-porting the older dpkg toolchain. Might be simpler to just use an etch chroot for that part. I've never looked into that area, maybe it's a non-issue. I notice dpkg has a --deb-format option, perhaps that's enough?
 

The Following User Says Thank You to toojays For This Useful Post:
endsormeans's Avatar
Posts: 3,141 | Thanked: 8,161 times | Joined on Feb 2013 @ From my Gabriola Island hermitage, near the Edge of the World
#10
ah...here I was thinking ..that you were thinking.. of a single package ...which seems to me to be quite a (if not well nigh an impossible) task...
__________________
Lurker since 2007, Member since 2013, Certifiable since 1972

Owner of :
1-n770 (in retirement), 3-n800's / 3-n810's (still in daily use), 5-n900's ((3 are flawless, 1 loose usb ( parts), 1 has no telephony (parts))
3-nexus 5's : 1 w/ Floko Pie 9.1 (running beautifully) waiting for Stable Droid 10 rom, 1 w/ ̶Ubuntu Touch, 1 with Maru OS (intend maemo leste when ready)

1/2 - neo900 pre- "purchased" in 2013. N̶o̶w̶ ̶A̶w̶a̶i̶t̶i̶n̶g̶ ̶r̶e̶f̶u̶n̶d̶ ̶p̶r̶o̶c̶e̶s̶s̶ ̶l̶a̶s̶t̶ ̶f̶e̶w̶ ̶y̶e̶a̶r̶s̶ - neo900 start up declared officially dead -
Lost invested funds.


PIMP MY N8X0 (Idiot's Guide and a video walkthrough)http://talk.maemo.org/showthread.php?t=94294
THE LOST GRONMAYER CATALOGShttp://talk.maemo.org/showthread.php...ight=gronmayer
N8X0 VIDEO ENCODING THE EASY WAYhttp://talk.maemo.org/showthread.php...ght=mediacoder
242gb ON N800http://talk.maemo.org/showthread.php?t=90634
THE PAIN-FREE MAEMO DEVELOPMENT LIVE DISTRO-ISO FOR THE NOOB TO THE PROhttp://talk.maemo.org/showthread.php?t=95567
AFFORDABLE MASS PRODUCTION FOR MAEMO PARTShttp://talk.maemo.org/showthread.php?t=93325

Meateo balloons now available @ Dave999's Meateo Emporium
 
Reply


 
Forum Jump


All times are GMT. The time now is 19:28.