WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] building gcc (w/ gcj)  (Read 7443 times)

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
[SOLVED] building gcc (w/ gcj)
« on: February 01, 2014, 09:39:11 PM »
(Perhaps this is better in the scripting or general sections, but I wasn't sure ... )

For PDFtk, I need gcj. So, I'm making a gcc-gcj extension for personal use. I did this on 32bit and it worked fine, but I'm beating my head against the wall trying to get 4.8.2 to compile on x86_64 for x86_64.

Current issue is the make chokes when it gets to libgomp. Make creates xgcc, and then libgomp says that xgcc doesn't work. That seems to be incorrect, though ... or at least I can get that new compiler to build a simple helloworld.c into a.out.

I've tried w/ and w/o distcc, rewriting my script, re-reading lotsa docs, changing CFLAGS/CXXFLAGS, adding -B to the 4.7.2 files, etc, etc. Advice welcome.

Build script + config log attached.
« Last Edit: February 04, 2014, 04:27:33 AM by dentonlt »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14636
Re: building gcc (w/ gcj)
« Reply #1 on: February 02, 2014, 12:57:29 AM »
Are you using the compiletc extension in corepure64 to do this?

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: building gcc (w/ gcj)
« Reply #2 on: February 02, 2014, 01:28:42 AM »
Yep. I've been using it to compile other things, and no major problems. I'll re-download it and deps to be sure.

Any other suggestions? I know you did the gcc ext, Juanito, so I appreciate it.

I'd even be happy with a 4.7.2 + gcj, in reality.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14636
Re: building gcc (w/ gcj)
« Reply #3 on: February 02, 2014, 01:35:23 AM »
If you're compiling a gcc add-on, you probably need mpc-dev and cloog-dev, which are not normally loaded by compiletc

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: building gcc (w/ gcj)
« Reply #4 on: February 02, 2014, 01:46:24 AM »
Yep, I have those installed during build. I'll re-download them, too. Thanks for mentioning.

Could this be because I'm on 5.2 / 3.8.13, and the headers are 3.8.10? I'm not compiling modules, so I didn't think it would matter. Maybe that was a poor assumption. I don't believe 3.8.13 headers are in the repository [yet?].

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14636
Re: building gcc (w/ gcj)
« Reply #5 on: February 02, 2014, 01:49:57 AM »
The 3.8.10 headers are the ones the tool chain was originally built with so they are the ones that should be used.

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: building gcc (w/ gcj)
« Reply #6 on: February 02, 2014, 01:52:14 AM »
Ah - that makes sense.

Just to be complete, I've redownloaded every extension I need to use during the build. Now I'll sit and wait a few minutes during the build :p

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: building gcc (w/ gcj)
« Reply #7 on: February 02, 2014, 02:11:45 AM »
No luck - same error as above.

New question: since mpl, binutils, etc. are all available in the repository, I have not included their source (as "optional"). Perhaps this was a poor decision?

I guess I'll try digging up all those and doing it altogether. I don't remember need to do that when I made the 32bit gcj, but maybe it's necessary here =\

[EDITED: stupid typo ... ]
« Last Edit: February 02, 2014, 02:15:03 AM by dentonlt »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14636
Re: building gcc (w/ gcj)
« Reply #8 on: February 02, 2014, 02:35:50 AM »
I don't think that will change anything, I'd suggest using compiletc (i.e. the standard tc-5.x gcc) and something like this:
Code: [Select]
CFLAGS="-mtune=generic -Os -pipe" CXXFLAGS="-mtune=generic -Os -pipe" ./configure --prefix=/usr/local --libexecdir=/usr/local/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-c99 --enable-long-long --enable-clocale=gnu --enable-languages=c,c++,java --disable-multilib --disable-libstdcxx-pch --enable-cloog-backend=isl --with-system-zlib --enable-frame-pointer --disable-bootstrap --disable-cloog-version-check

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: building gcc (w/ gcj)
« Reply #9 on: February 02, 2014, 02:44:27 AM »
I pulled the flags from the wiki, as normal, and then your gcc config from 4.7.2 using gcc -v ... so that looks like how I started :)

That's pretty much what I'm using now, but I struck a few things (-pipe, -Os, --enable-shared [default]) while trying to figure out what's wrong. I'll use exactly what you posted and try again.

Thanks again for the assistance with this ... It's really annoying me.

DLT

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: building gcc (w/ gcj)
« Reply #10 on: February 02, 2014, 03:42:19 AM »
Still no good. At least I get the "can't run C compiled programs" error at a different point. End of make log below, and current build script attached.

I'll reboot, disable distcc, remove -jN, and try again. =\

Code: [Select]
configure: error: in `/home/tc/builder/gcc-4.8.2/gcc-4.7.2-objdir/x86_64-unknown-linux-gnu/libmudflap':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
configure: error: in `/home/tc/builder/gcc-4.8.2/gcc-4.7.2-objdir/x86_64-unknown-linux-gnu/libffi':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[1]: *** [configure-target-libmudflap] Error 1
make[1]: *** Waiting for unfinished jobs....
configure: error: in `/home/tc/builder/gcc-4.8.2/gcc-4.7.2-objdir/x86_64-unknown-linux-gnu/libgomp':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
configure: error: in `/home/tc/builder/gcc-4.8.2/gcc-4.7.2-objdir/x86_64-unknown-linux-gnu/libssp':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[1]: *** [configure-target-libffi] Error 1
configure: error: in `/home/tc/builder/gcc-4.8.2/gcc-4.7.2-objdir/x86_64-unknown-linux-gnu/zlib':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[1]: *** [configure-target-libgomp] Error 1
configure: error: in `/home/tc/builder/gcc-4.8.2/gcc-4.7.2-objdir/x86_64-unknown-linux-gnu/libquadmath':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[1]: *** [configure-target-libssp] Error 1
make[1]: *** [configure-target-zlib] Error 1
make[1]: *** [configure-target-libquadmath] Error 1
make: *** [all] Error 2

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: building gcc (w/ gcj)
« Reply #11 on: February 02, 2014, 05:03:06 AM »
Failed on base norestore.  :-[
Again, the same error. Gets to libgomp, and then crash out with "cannot run C compiled programs."

I'll keep looking for other options/variables.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10992
Re: building gcc (w/ gcj)
« Reply #12 on: February 02, 2014, 05:29:47 AM »
Could be the xgcc script prefers bash, or gnu utils vs busybox?
The only barriers that can stop you are the ones you create yourself.

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: building gcc (w/ gcj)
« Reply #13 on: February 02, 2014, 05:57:03 AM »
Thanks, curaga, but already using bash + gnu utils (gawk in particular is required). =\

Any other loose ends that you can think of that might need non-busybox???

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10992
Re: building gcc (w/ gcj)
« Reply #14 on: February 02, 2014, 06:30:03 AM »
Hm, well some apps want the glibc_apps extension, it's not a compiletc dep.

edit: Of course you could use your 32-bit system to build a static pdftk binary? That would then run fine on your 64-bit box too.
« Last Edit: February 02, 2014, 06:31:41 AM by curaga »
The only barriers that can stop you are the ones you create yourself.