Error compiling GCC 3.4.6 in Ubuntu 14.04
Asked Answered
E

1

10

I am trying to compile GCC 3.4.6 in Ubuntu 14.04 x64. It already has newer version of GCC-4.8.2.

I ran ./configure --prefix=/usr/local/gcc-3.4 and make.

I ended up in several errors for which I could find solutions on searching.

Error 1

Error 2

Finally I ended up in this error, which I couldn't find any solution.

../../gcc/unwind-dw2.c: In function `uw_frame_state_for':
../../gcc/unwind-dw2.c:1031: error: field `info' has incomplete type
make[2]: *** [libgcc/32/unwind-dw2.o] Error 1
make[2]: Leaving directory `/home/hp-11/Documents/gcc-3.4.6/build/gcc'
make[1]: *** [stmp-multilib] Error 2
make[1]: Leaving directory `/home/hp-11/Documents/gcc-3.4.6/build/gcc'
make: *** [all-gcc] Error 2

Does anybody know how to fix it? Please let me know if more details are needed.

Engel answered 15/10, 2014 at 5:57 Comment(3)
To compile old versions of gcc, you would usually have to go with smaller steps: use gcc-4.8 to compile gcc-4.6, then use gcc-4.6 to compile gcc-4.3 (I picked random numbers, I don't know which work), etc.Orts
Why do you need such an old version of GCC ?Timothytimour
Need to install HTK, HDecode, HTS etc.Engel
E
19

This is old good-known problem, regarding siginfo and siginfo_t

All you need is to look at you GCC sources for all places like

struct rt_sigframe {            \
  int sig;              \
  struct siginfo *pinfo;          \
  void *puc;              \
  struct siginfo info;            \
  struct ucontext uc;           \
} *rt_ = (CONTEXT)->cfa;          \
sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext;   \

this one is inside gcc/config/i386/linux.h but your arch may differ

And manually replace struct siginfo * to siginfo_t * and struct siginfo to siginfo_t, making it newest POSIX compatible. In every rt_sigframe declaration there is most common to be two such places, including your info field of problem.

Erny answered 15/10, 2014 at 6:19 Comment(4)
Thank you. This problem solved (although I ended up in a new problem now). Unfortunately, I don't have enough rep to upvote your answer :(Engel
I did what has been mentioned in the answer, but continue to receive the same error. I did a search for all instances of siginfo and replaced them with siginfo_t. Also did a make clean, deleted and recreated the objdir (inside which I am building gcc-3.4.6), but the same error. Any suggestions? I have Ubuntu 15.04 i686.Ebberta
There is no magic in this world. If you do have "incomplete type" message for some structure, you should figure out the field in this structure that is of incomplete type. May be in your case it is ucontext or so. Just determine compilation line that fails, then compile with -E to see preprocessed source and carefully look for definitions -- you will see the absent one.Erny
Yes, the other one is struct ucontext. It needs to be replaced with ucontext_t.Trela

© 2022 - 2024 — McMap. All rights reserved.