Author Topic: Zgcc Segfaults A Lot  (Read 5234 times)

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Zgcc Segfaults A Lot
« on: March 05, 2007, 10:51:08 am »
I'm trying to compile the latest Aleph One (which, if somebody cares to compile it in an optimized or semi-optimized way, go ahead, but please post an ipk   ), but GCC from zgcc-3.4.6.img (r121) segfaults quite often, not always in the same place. Is there some good way to avoid this, or to pick up where it left off?

Thanks.
« Last Edit: March 05, 2007, 10:51:48 am by Capn_Fish »
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
Zgcc Segfaults A Lot
« Reply #1 on: March 05, 2007, 11:47:51 am »
Quote
I'm trying to compile the latest Aleph One (which, if somebody cares to compile it in an optimized or semi-optimized way, go ahead, but please post an ipk   ), but GCC from zgcc-3.4.6.img (r121) segfaults quite often, not always in the same place. Is there some good way to avoid this, or to pick up where it left off?

Thanks.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155406\"][{POST_SNAPBACK}][/a][/div]

Are you using swap ? It's often due to memory problems.

Then again, I had the same issue on dosbox 0.66rc3. I used the cross-compiler and all went fine.

Chero.
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Zgcc Segfaults A Lot
« Reply #2 on: March 05, 2007, 12:15:58 pm »
I have plenty (~500MB) of swap. I seem to get a "cc1plus killed" or some such error instead of a segfault if I don't use it.

I tried the cross-compiler, but it fails saying that it "cannot read symbole: file in wrong format" for libcseries.a.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
Zgcc Segfaults A Lot
« Reply #3 on: March 05, 2007, 01:56:07 pm »
Quote
I have plenty (~500MB) of swap. I seem to get a "cc1plus killed" or some such error instead of a segfault if I don't use it.

I tried the cross-compiler, but it fails saying that it "cannot read symbole: file in wrong format" for libcseries.a.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=155421\"][{POST_SNAPBACK}][/a][/div]

Sound like it's not really cross-compiling or you have a broken file.

Chero.
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

jcabrer

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Zgcc Segfaults A Lot
« Reply #4 on: March 05, 2007, 01:59:24 pm »
I compiled AlephOne originally for the Z.  I'll dig it up and see if I can get the latest to compile.

One thing to note:  I didn't use zgcc.  Instead, I intalled a full development environment (binutils, automake, autoconf, make, m4, patchutils, gcc...) on a 4Gb CF-Drive with 512Mb allocated to swap.

If you want optimizations, let me know and I'll add them into the CCFLAGS.
Sharp SL-C3100 - pdaXrom Beta 3
Sharp SL-6000L - pdaXrom Beta 1

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Zgcc Segfaults A Lot
« Reply #5 on: March 06, 2007, 11:00:05 am »
Thanks! CFLAGS/CXXFLAGS that I would like used:

"-O3", or, should that not work, "-O2"

"-mtune=iwmmxxt", or, should that not work, "-mtune=xscale"

"-mcpu=xscale"

"-fomit-frame-pointer"

I hope one or more of those will work as the older build is almost perfectly playable, and those should make this one work better.

Thanks again, both for trying this build and for the old one (which I am currently enjoying).
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

jcabrer

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Zgcc Segfaults A Lot
« Reply #6 on: March 13, 2007, 04:00:54 pm »
Ok.  My first successful compile resulted in a binary that runs and quits without actually going into the application.  Just for good measure, I'm going back and re-compiling all my deps like SDL and LUA...

I'll get it eventually.

I'm going to try with

-O3 -mtune=xscale -mcpu=xscale -fomit-frame-pointer

first.  I'm not sure if -mtune=iwmmxxt will work while compiling on TOSA.  Does anyone know?  Will there be a binary-compatability issue?  I suppose I can put up multiple binaries for the various platforms.
Sharp SL-C3100 - pdaXrom Beta 3
Sharp SL-6000L - pdaXrom Beta 1

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Zgcc Segfaults A Lot
« Reply #7 on: March 13, 2007, 04:28:06 pm »
Great!

I think using -mtune=iwmmxt should work, but I'm not sure. Give it a shot and let us know how it goes.

As for the compatibility thing, I believe I used those optimizations for something and posted that if people had issues on non-iwmmxt Zaurii they could PM me and I'd rebuild it, but I got no PMs, so I guess it works across the models, even those without iwmmxt.

Once again, thanks for doing this. If you do get it to build, could you post any special steps you used and how you set up your compiler?
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Zgcc Segfaults A Lot
« Reply #8 on: March 13, 2007, 07:48:22 pm »
Quote
Ok.  My first successful compile resulted in a binary that runs and quits without actually going into the application.  Just for good measure, I'm going back and re-compiling all my deps like SDL and LUA...

I'll get it eventually.

I'm going to try with

-O3 -mtune=xscale -mcpu=xscale -fomit-frame-pointer

first.  I'm not sure if -mtune=iwmmxxt will work while compiling on TOSA.  Does anyone know?  Will there be a binary-compatability issue?  I suppose I can put up multiple binaries for the various platforms.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156136\"][{POST_SNAPBACK}][/a][/div]

I think that the tuning option iwmmxt is ignored on the native compiler and is replaced internally with xscale while it works on the cross compiler
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

jcabrer

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Zgcc Segfaults A Lot
« Reply #9 on: March 14, 2007, 01:15:14 pm »
OK.  I only compile native, so iwmmxt is out, at least for now.

Anyway, the file is up on my feed site http://pdaxfeed.dyndns.org/feeds/games

I posted to the new files release post as well.

You need to install the game and at least one of the data files.  I haven't made Launcher Icons for this game yet, so you have to run it from the command line.

I usually type alephone-[TAB] to gt the list of available games.

By the way, I've not really tested my feed site yet, so please feel free to mirror the file ASAP in case I need to take the server down to tweak things.
Sharp SL-C3100 - pdaXrom Beta 3
Sharp SL-6000L - pdaXrom Beta 1

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Zgcc Segfaults A Lot
« Reply #10 on: March 14, 2007, 02:13:35 pm »
Thank you! I'm downloading it now...

What flags did you use?
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

jcabrer

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Zgcc Segfaults A Lot
« Reply #11 on: March 14, 2007, 02:41:12 pm »
Quote
Thank you! I'm downloading it now...

What flags did you use?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156283\"][{POST_SNAPBACK}][/a][/div]

-O3 -mtune=xscale -mcpu=xscale -fomit-frame-pointer

Here is what I had to do to get things going:

downloaded source for the boost library, and created a symlink to the ./include/boost directory in /opt/...native/.../include

Installed development versions of the SDL, SDL_sound, and SDL_net libraries.
Installed development version of LUA and libao.

./configure
make; make install

no problem :^)
Sharp SL-C3100 - pdaXrom Beta 3
Sharp SL-6000L - pdaXrom Beta 1

jcabrer

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Zgcc Segfaults A Lot
« Reply #12 on: March 14, 2007, 02:42:05 pm »
Is it working? Is it working? Is it working!!!!????
Sharp SL-C3100 - pdaXrom Beta 3
Sharp SL-6000L - pdaXrom Beta 1

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Zgcc Segfaults A Lot
« Reply #13 on: April 27, 2007, 03:11:28 pm »
Quote
Quote
Thank you! I'm downloading it now...

What flags did you use?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156283\"][{POST_SNAPBACK}][/a][/div]

-O3 -mtune=xscale -mcpu=xscale -fomit-frame-pointer

Here is what I had to do to get things going:

downloaded source for the boost library, and created a symlink to the ./include/boost directory in /opt/...native/.../include

Installed development versions of the SDL, SDL_sound, and SDL_net libraries.
Installed development version of LUA and libao.

./configure
make; make install

no problem :^)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156285\"][{POST_SNAPBACK}][/a][/div]
Trying to build the latest version, and I STILL can't get it to find the boost libs. I symlinked boost_1_34_0/boost (a folder with headers) to /opt/.../include, /opt/.../armv5tel-cacko-linux/include, and /usr/include with no luck. Any help from anybody would be much appreciated, as I would like to figure out why it isn't finding the headers.

I copied the ZGCC image's contents to /opt/... to allow for symlinks into those dirs, if it makes a difference.

Thanks.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Zgcc Segfaults A Lot
« Reply #14 on: April 27, 2007, 03:18:40 pm »
I figured it out. I had to add CPPFLAGS="-I/mnt/ide2/files/boost_1_34_0" and it found the files. I though I had tried that previously, but I guess not.

Hope this helps somebody.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo