This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.


Thanks installing GCC via make install solved my issue, however some
other concern came up.

Our existing gcc version is 4.1.2

Linux:>/x/local/prakash_prasad/gimp/code 1057> gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Our codebase compiles fine with this GCC version but not with GCC
4.5.0. It throws a lot of error which we need to fix is again an Org
level initiative.

However my intention was to implement this -
https://lwn.net/Articles/457543/  - I wanted to write an a new GCC
pass which requires a minimum GCC 4.5.0 [as per the document]. Now
currently either our Org has to upgrade the code to compile with GCC
4.5.0 [which definitely is not possible now] or please let me know any
alternative way to implement it in GCC pass in 4.1.2  version?

Thanks in advance.

Regards,
Prakash


On Mon, Feb 13, 2012 at 2:00 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 13 February 2012 21:21, Satya Prakash Prasad wrote:
>> Thanks for the info.
>>
>> I do understand that I should work with GCC 4.5.3 but this is a
>> generic question / issue for which I seek help. So please let me know
>> the workaround / fix if the same is applicable for GCC 4.5.3 version.
>
> Yes, it's applciable, but since you don't seem to have a good reason
> to use 4.5.0 you should *really* use 4.5.3 instead, or your developers
> will encounter a number of bugs that have already been fixed and they
> will get annoyed at you.
>
>> I actually move GMP / MPFR / MPC under gcc-4.5.0 folder:
>>
>> Created gmp / mpfr / mcp folders and copied / extracted respective tar
>> files. Doing this way I was able to successfully build GCC 4.5.0
>>
>> Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0
>> 1003>/x/home/prakash_prasad/shared_scripts/bin/gcc/gcc-4.5.0/configure
>> --prefix=/x/home/prakash_prasad/shared_scripts/bin/gcc/gcc-4.5.0
>
> Why are you configuring with prefix set to the source directory?
>
>> --enable-shared --enable-threads=posix --enable-__cxa_atexit
>> --enable-clocale=gnu --enable-languages=c,c++
>>
>> However I see the following binaries getting build -
>>
>> Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1030> find . -name '*gcc'
>> -perm /u=x,g=x,o=x -type f -exec ls -l \{} \;
>> -rwxrwxr-x 1 prakash_prasad ppusers 705019 Feb 13 10:04
>> ./host-x86_64-unknown-linux-gnu/gcc/xgcc
>> -rwxrwxr-x 1 prakash_prasad ppusers 513868 Feb 12 18:57
>> ./host-x86_64-unknown-linux-gnu/stage1-gcc/xgcc
>> -rwxrwxr-x 1 prakash_prasad ppusers 300059 Feb 12 19:45
>> ./host-x86_64-unknown-linux-gnu/prev-gcc/xgcc
>> Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1031>
>>
>> Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1031> find . -name 'g++'
>> -perm /u=x,g=x,o=x -type f -exec ls -l \{} \;
>> -rwxrwxr-x 1 prakash_prasad ppusers 712422 Feb 13 10:04
>> ./host-x86_64-unknown-linux-gnu/gcc/g++
>> -rwxrwxr-x 1 prakash_prasad ppusers 304198 Feb 12 19:45
>> ./host-x86_64-unknown-linux-gnu/prev-gcc/g++
>> Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1032>
>
> That's expected if you haven't run "make install" yet.
>
>> Is gcc executable and xgcc are same?
>
> The binaries will be renamed when they are installed.
>
> You need to run "make install" for the compiler to be usable.
>
>> Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1032> cat test.cpp
>>
>> #include <iostream>
>> #include <stdio.h>
>>
>> main()
>> {
>> printf("Test\n");
>> std::cout<<"Test" << std::endl;
>> }
>>
>> And got the below output:
>>
>> Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1148>
>> ./host-x86_64-unknown-linux-gnu/gcc/xgcc --version
>> xgcc (GCC) 4.5.0
>> Copyright (C) 2010 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions. ?There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
>> Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1036>
>> ./host-x86_64-unknown-linux-gnu/gcc/g++ --version
>> g++ (GCC) 4.5.0
>> Copyright (C) 2010 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions. ?There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
>> Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1149>
>> ./host-x86_64-unknown-linux-gnu/gcc/xgcc test.cpp
>> xgcc: error trying to exec 'cc1plus': execvp: No such file or directory
>>
>> Linux:>~/shared_scripts/bin/gcc/gcc-4.5.0 1035>
>> ./host-x86_64-unknown-linux-gnu/gcc/g++ test.cpp
>> g++: error trying to exec 'cc1plus': execvp: No such file or directory
>>
>> Kindly note that I using stage1 boxes where we do not have permissions
>> to install anything.
>
> I don't know what a stage1 box is, but you need to install the
> compiler with "make install" or it won't work without setting paths
> manually.
>
>> Will this issue will happen for version GCC 4.5.3 also?
>
> Yes.
>
>
>> What is the
>> fix for same and any workaround for same?
>
> You need to install gcc. ?You haven't finished the installation
> process, all you've done is build it.
>
>> What do I need to install
>> further,
>
> You need to install gcc, you haven't done that.
>
> You can install it to a staging area, then copy/move it to its final
> location, but you must install it to finish the build+installation
> process. ?To install to a staging area use e.g.
>
> make install DESTDIR=/path/to/staging/area


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]