Clone
5
Developers
Dmitriy Kuminov edited this page 2020-05-06 18:17:57 +03:00

This section contains information related to developing GCC on OS/2.

Repository Structure

The original Qt source code is in SVN with a GIT mirror. The web interface for the GIT repository is available at https://gcc.gnu.org/git/?p=gcc.git.

We don't, however, maintain a complete clone here for exactly the same reasons we don't do that when working on our Qt 5 port - to save time/space when checking out local clones and to stay focused on the OS/2 development (the upstream repository is updated very frequently, several comments every hour or such). Instead, we use a technique of "squashing" to combine all upstream commits into one. Please refer to this page where it all described in detail: https://github.com/bitwiseworks/qt5-os2/wiki/Developers#repository-structure. This page also describers the tag pocliy and steps to update our repository to a new version from upstream. These steps should be followed with an exception that the upstream repository URL is git://gcc.gnu.org/git/gcc.git and the format of OS/2 tags for GCC is as follows : gcc-X_Y_Z-release-os2[-NNN] - to follow the original GCC tag layout which is gcc_X_Y_Z-release and should be also preserved when marking imports on the vendor branch and further merges to master. The commit message templates for imports and merges, consequentially, are:

vendor: Import gcc-X_Y_Z-release.

Source URL:    git://gcc.gnu.org/git/gcc.git
Source Commit: NNNN
Merge vendor gcc-X_Y_Z-release.

Conflicts resolved:
    ....
    (conflicting file listing from the standard merge message, if any)

Building GCC

These instructions assume you have the RPM/YUM environment installed. See http://svn.netlabs.org/rpm for details.

  1. Install the necessary packages from RPM with:
yum install ash make libc-devel binutils zlib-devel gettext bison flex texinfo perl gmp-devel mpfr-devel mpc-devel python-devel python gcc gcc-c++ gcc-wlink libtool
  1. Clone the source tree (e.g. to gcc/master).
  2. Make a build directory outside the source tree (e.g. gcc/master-build).
  3. Run autoconf && configure & make && install using the following shell script (assuming you are in gcc):
export LANG=C

# 1) To be run once after git clone or git pull.

cd master && autogen.sh && cd ..

# 2) To be run after 1) or each time you change configure options.

export CFLAGS='-O2 -g -march=pentium4'
export CXXFLAGS='-O2 -g -march=pentium4'
export LDFLAGS='-g -Zomf -Zmap -Zargs-wild -Zhigh-mem'
export LDFLAGS_FOR_TARGET="$LDFLAGS"

cd master-build

../master/configure \
--prefix=`realpath ../master-install` \
--enable-maintainer-mode \
--disable-bootstrap \
--enable-languages=c,c++ \
--build=i686-pc-os2-emx \
--with-sysroot=/@unixroot \
--with-bugurl=dev_build_no_slash \
--enable-shared \
--enable-threads \
--enable-checking=release \
--disable-multilib \
--with-system-zlib \
--with-gcc-major-version-only \
--without-isl --with-tune=generic \
--with-arch=i686 \
--with-gnu-as \
--disable-libstdcxx-pch

# 3) To be run to actually build stuff (or after fixing build errors etc).

BUILD_DIR=`realpath .`
export PATH="$BUILD_DIR/gcc${PATH:+;$PATH}"
export BEGINLIBPATH="$BUILD_DIR/gcc${BEGINLIBPATH:+;$BEGINLIBPATH}"
export LIBPATHSTRICT=T

make -j4

# 4) To be run after 3) to install GCC to `gcc/master-install`.

make install