Jump to Navigation

Recently created

Preliminaries

Introduction

Before starting to compile, you must determine your host system, your target system and the aliases you want to use for the last two. It is also useful to determine the object file format you use. Of course you must also download the sources.

Overview

Introduction

This document will show you how to (re)compile glibc-2 and all supporting packages. We will use only the source distributions; usually, it is a good idea not to install binary packages, because they often lack some of the documentation and may use undesirable defaults. And compiling your own sources is much more fun :-).

Packages

Note that by the time you read this, newer versions of the packages may have been released!

Other sites

The GNU Libc2 with Linux site (no longer online) contains a wealth of information regarding glibc-2 and lots of pointers to other documents.

Stefan Morrell describes how you can migrate completely to glibc2, making it the default environment. His page is called Migrating to Gnu 'C' Library Version 2 (or how I did it!) (no longer online).

Libc++

Introduction

This is the final step in installing glibc-2. To compile C++ programs, one needs the C++-library. Because this library uses the C-library, you need separate versions for the old libc-5 target and the new libc-6 target. You will see that the commands for compiling both versions are exactly the same, except for an optional parameter indicating the current machine type and a different installation directory. Therefor, compilation of this library is a good illustration of how to use the new compilation environment.

Libc6

Introduction

This is the fourth step in installing glibc-2. We now install the library itself. We can do this before we generate a cross-compiler, because the binary formats of libc-5 and libc-6 objects are the same; we must do this first because we need the header files before we can create the cross-compiler, and the header files are dynamically created.

Libc5

Introduction

This is the sixth step in installing glibc-2. Here we upgrade our main libc to the last version. Though you do not need to do this to be able to use glibc-2, it is still sensible to upgrade your libc-5 if it is old.

Ld.so

Introduction

This is the second step in installing glibc-2. Before we install anything for glibc-2, we first update the dynamic linker. This is the program that admistrates all shared libraries and loads them when needed. Glibc uses its own dynamic linker, but the old dynamic linker must cooperate with it. Only versions newer than 1.9.0 do that.

Introduction

Linux systems commonly use libc-5 as their main libc. This is the version which introduced ELF to Linux, and most distributions still come with it. Glibc-2 , aka. libc-6, is the way of the future for Linux. Regrettably, it is not 100% compatible with libc-5; though the problems are minor, many packages are not yet upgraded to compile cleanly with the new libc. Also, you must keep libc-5 around until all your dynamically linked applications are recompiled against libc-6.

Glibc installation

Introduction

This document describes what I had to do to get glibc-2, also known as libc-6, installed on my Linux system. It contains a step-by-step guide to recompile and install all components needed.

Note that, though I have checked and rechecked this document to the best of my abilities, there may still be bugs and omissions, both small and large. I use glibc-2 myself after the setup described here without any problem, but your mileage may differ. I would be grateful for any comments or corrections you send me - and perhaps a small note if this also works for you...

Going on from here

Introduction

If you have followed all the steps in this guide, you will now have a working cross-compiler installed. So now you can generate programs which are linked against glibc-2. But before you go on, there are a couple of things which are useful to know.

Pages

Subscribe to Recently created


by Dr. Radut