John
John

Reputation: 13

Installing glibc-2.29 from source in kali linux

I need a debug version of glibc.I have some doubts regarding the installation of glibc-2.29 from source in kali linux.Based on the post https://www.tldp.org/HOWTO/html_single/Glibc-Install-HOWTO/,

To install glibc you need a system with nothing running on it, since many processes (for example sendmail) always try to use the library and therefore block the files from being replaced. Therefore we need a "naked" system, running nothing except the things we absolutely need. You can achieve this by passing the boot option init=/bin/bash to your kernel.

it says that we need to install the glibc in a single usermode environment.In another post https://www.tldp.org/HOWTO/Glibc2-HOWTO-5.html single usermode is not required for installation but backing up the old libraries.I dont know which one to follow.Can anyone help?

Upvotes: 0

Views: 2047

Answers (2)

John
John

Reputation: 13

I found that we can use glibc without installing but building from source by adding '-g' flag in ./configure and setting LD_LIBRARY_PATH varible as follows after building

LD_LIBRARY_PATH=/path/to/the/build_directory gdb -q application

Note: this solution only works when the system GLIBC and the built-from-source GLIBC exactly match, as explained here.

Upvotes: 1

Employed Russian
Employed Russian

Reputation: 213375

I need a debug version of glibc.

Most distributions supply ready-made libc6-dbg packages that match your installed GLIBC. This is the best approach unless you are a GLIBC developer (or plan to become one).

I have some doubts regarding the installation of glibc-2.29 from source in kali linux.

Installing / replacing system libc is almost guaranteed to render your system unbootable if there are any mistakes. Recent example.

Before you begin, make sure you either know how to recover from such a mistake (have a rescue disk ready and know how to use it), or you have nothing of value on the system and can re-image it from installation media in the likely case that you do make a mistake.

The document you referenced talks about upgrading from libc5 to libc6. It was last updated on 22 June 1998, and is more than 20 years old. I suggest you find some more recent sources. Current documentation does suggest doing make install while in single-user mode.

Upvotes: 0

Related Questions