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.

3
  • 1
    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. Commented Oct 15, 2014 at 6:21
  • Why do you need such an old version of GCC ? Commented Oct 15, 2014 at 6:42
  • Need to install HTK, HDecode, HTS etc. Commented Oct 15, 2014 at 7:05

1 Answer 1

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.

3
  • 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 :( Commented Oct 15, 2014 at 7:34
  • 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.
    – Sarvavyapi
    Commented May 31, 2015 at 0:13
  • 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. Commented Jun 1, 2015 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.