User forums > General (but related to Code::Blocks)

GCC 4.1.2 available (now relocatable!)

<< < (3/13) > >>

TDragon:

--- Quote from: Biplab on February 27, 2007, 03:44:57 pm ---Shall I upload the binary (Compiled GCC) for you to some location?

--- End quote ---
Sure -- then I can test it to make sure the issue's not just specific to your machine. I'm sure you already know this: what I would want is the contents of "blah" from the "make DESTDIR=blah install" command. (I don't need any of the MinGW components.)

Biplab:
Please download the file from the following link.


--- Quote ---http://www.fileden.com/files/4628/GCC-3.4.6.7z
--- End quote ---

AFAIR, the build was configured with ../configure --prefix=/c/temp/gcc-3.4.6 ....

The archive has GCC, G++ and GOBJC.

Thanks & Regards,

Biplab

TDragon:
With many thanks to wxLearner for the tip, a new, fully relocatable build is available directly from my site (removed due to excessive bandwidth usage) or hosted at filefront.com. (gcc-4.1.2-c+cxx-mingw-tdm-r1.7z: 7-zip archive, 9.39 MB)

As an extra tidbit, I have succesfully used this 7-zip archive, along with the MinGW components listed below, to install GCC 4.2.1 and successfully build and run Code::Blocks with it on two other machines, one running XP Pro SP2 and one running Win2k.

Hints for creating a relocatable build came from this mailing list message, although I encountered a few additional necessary steps not mentioned there. In particular, using a nonexistent path as the prefix failed; the installation required various MinGW components to already be present in the installation directory.
Following is the full set of steps I took: (changes marked in bold)
1. Download and extract gcc-core-4.1.2.tar.gz and gcc-g++-4.1.2.tar.gz (creates directory "gcc-4.1.2")
2. Download this patch and save in the same parent directory (we'll call it <gccbuildpath>)
3. Open mSYS
4. $ cd <gccbuildpath>/gcc-4.1.2
5. $ patch -b -p0 -i ../bug27067.patch
6. Exit mSYS
7. Create directory "gcc-4.1.2-obj" next to "gcc-4.1.2"
8. Ensure that C:\MinGW contains a full MinGW installation with GCC 3.4.5
9. Open <pathtomsys>\etc\fstab and make sure entry "c:/MinGW /mingw" exists
10. Open mSYS
11. $ cd <gccbuildpath>/gcc-4.1.2-obj
12. $ ../gcc-4.1.2/configure --with-gcc --with-gnu-ld --with-gnu-as --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++ --disable-win32-registry --enable-fully-dynamic-string
13. $ make CFLAGS="-O2 -fomit-frame-pointer" CXXFLAGS="-mthreads -fno-omit-frame-pointer -O2" LDFLAGS=-s bootstrap 2>errlog.txt
14. Wait a few minutes. Make a pot of coffee.
15. make fails at step "Bootstrapping the compiler"; check errlog.txt to find error: Makefile:1280: *** target pattern contains no `%'.
16. Open <gccbuildpath>\gcc-4.1.2-obj\gcc\Makefile, go to line 1280, see that error is referring to $(ORIGINAL_LD_FOR_TARGET). Find definition of ORIGINAL_LD_FOR_TARGET (line 359), see that it's incorrectly set as "./c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../mingw32/bin/ld.exe". Change to the saner "/mingw/bin/ld" (following the pattern of ORIGINAL_NM_FOR_TARGET right below it, which is correctly set). Save Makefile.
17. Return to mSYS window, repeat previous make command (make CFLAGS="-O2 -fomit-frame-pointer" CXXFLAGS="-mthreads -fno-omit-frame-pointer -O2" LDFLAGS=-s bootstrap 2>errlog2.txt)
18. Wait a lot of minutes. Prepare and consume a 5-course dinner.
19. Rename C:\MinGW as C:\MinGW-old
20. Create new C:\MinGW and extract contents of binutils-2.17.50-20060804-1.tar.gz, mingw32-make-3.81-1.tar.gz, mingw-runtime-3.11.tar.gz, and w32api-3.7.tar.gz there.
21. $ make install

At this point, C:\MinGW now contains nearly an entire MinGW installation. This is fine for people who don't want to distribute it; I had to use diff to determine the new and changed files (comparing against a copy of the contents of C:\MinGW before running make install) and separate them out by hand. There's probably a faster way of doing it.

22. Copy i686-pc-mingw32-gcc.exe to mingw32-gcc.exe and i686-pc-mingw32-g++.exe to mingw32-g++.exe (for easy compatibility)

Grom:
The compilation with 4.1.2 gave me  undefined reference to `__cpu_features_init'
:: === Build finished: 1 errors, 0 warnings ===
 :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:

TDragon:

--- Quote from: Grom on February 27, 2007, 05:58:11 pm ---The compilation with 4.1.2 gave me  undefined reference to `__cpu_features_init'

--- End quote ---
Please describe how you installed 4.1.2 and give your project's full command line log (enabled from Settings->Compiler and debugger->Other settings->Compiler logging->Full command line).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version