Gnu tool in linux

Gnu tool in linux

The GNU Binutils are a collection of binary tools. The main ones are:

  • ld — the GNU linker.
  • as — the GNU assembler.
  • gold — a new, faster, ELF only linker.
  • addr2line — Converts addresses into filenames and line numbers.
  • ar — A utility for creating, modifying and extracting from archives.
  • c++filt — Filter to demangle encoded C++ symbols.
  • dlltool — Creates files for building and using DLLs.
  • elfedit — Allows alteration of ELF format files.
  • gprof — Displays profiling information.
  • gprofng — Collects and displays application performance data.
  • nlmconv — Converts object code into an NLM.
  • nm — Lists symbols from object files.
  • objcopy — Copies and translates object files.
  • objdump — Displays information from object files.
  • ranlib — Generates an index to the contents of an archive.
  • readelf — Displays information from any ELF format object file.
  • size — Lists the section sizes of an object or archive file.
  • strings — Lists printable strings from files.
  • strip — Discards symbols.
  • windmc — A Windows compatible message compiler.
  • windres — A compiler for Windows resource files.

Most of these programs use BFD, the Binary File Descriptor library, to do low-level manipulation. Many of them also use the opcodes library to assemble and disassemble machine instructions.

The binutils have been ported to most major Unix variants as well as Wintel systems, and their main reason for existence is to give the GNU system (and GNU/Linux) the facility to compile and link programs.

Obtaining binutils

The latest release of GNU binutils is 2.40. The various NEWS files (binutils, gas, and ld) have details of what has changed in this release.

See the SOFTWARE page for information on obtaining releases of GNU binutils and other GNU software. The current release can be downloaded from https://ftp.gnu.org/gnu/binutils.

If you plan to do active work on GNU binutils, you can access the development source tree by anonymous git:

git clone git://sourceware.org/git/binutils-gdb.git

Alternatively, you can use the gitweb interface, or the source snapshots, available as bzipped tar files via anonymous FTP from ftp://sourceware.org/pub/binutils/snapshots.

Bug reports

Mailing lists

There are three binutils mailing lists:

bug-binutils@gnu.org (archives) For reporting bugs. binutils@sourceware.org (archives) For discussing binutils issues. binutils-cvs (archives) A read-only mailing list containing the notes from checkins to the binutils git repository. (This list has an odd name for historical reasons.)

To subscribe to the binutils@sourceware.org mailing list, see the binutils mailing list page.

To subscribe to the bug-binutils@gnu.org mailing list, see the bug-binutils info page.

You may wish to browse the old mail archives of the gas2 and bfd mailing lists. These were the discussion lists for binutils until May 1999. Please do not send mail to them any longer.

Читайте также:  What is vector linux

Documentation

A guide to porting the binutils to a new target has been contributed.

“The Free Software Foundation (FSF) is a nonprofit with a worldwide mission to promote computer user freedom. We defend the rights of all software users.”

Please send general FSF & GNU inquiries to . There are also other ways to contact the FSF. Broken links and other corrections or suggestions can be sent to .

Please see the Translations README for information on coordinating and contributing translations of this article.

Copyright © 2022 Free Software Foundation, Inc.

Updated: $Date: 2023/01/15 09:13:25 $

Источник

How to Install GNU GCC (C and C++ Compiler) and Development Tools in RHEL/CentOS and Fedora

Nowadays, as a system administrator or engineer you can’t feel satisfied by knowing how to use the CLI and troubleshoot GNU/Linux servers, but will need to go one step further into the development area as well to stay at the top of your game. If you’re considering a career in kernel development or applications for Linux, then C or C++ is the best place to start.

Install C C++ Compiler and Development Tools

In this article we will explain how to install Gnu C and C++ compilers and it’s related Development tools such as automake, autoconf, flex, bison, etc. in Fedora and CentOS / RHEL systems.

What is Compiler?

In simple words, a compiler is a software program that transforms statements written in a source language into a target language that the machine’s CPU can understand and execute.

In Fedora and derivatives (actually, that is true for the entire Linux distro ecosystem as well), the most well-known C and C++ compilers are gcc and g++, respectively, both developed and supported actively by the Free Software Foundation as part of the GNU project.

Installing GCC (C++ Compiler and Development Tools

If gcc and / or g++ and it’s related Development Tools are not installed in your system by default, you can install the latest available from the repositories as follows:

# yum groupinstall 'Development Tools' [on CentOS/RHEL 7/6] # dnf groupinstall 'Development Tools' [on Fedora 22+ Versions]

Before we dive into writing C or C++ code, there’s another tool to boost your development toolset that we want to show you.

Speeding up C and C++ Compilations in Linux

When you as part of the development process, have to recompile several times after making changes to the source code it’s great to have a compiler cache to speed up future recompilations.

In Linux, there’s an utility called ccache, which speeds up recompilation by caching previous compilations and detecting when the same compilation is being done again. Besides C and C++, it also supports Objective-C and Objective-C++.

Ccache has only a few limitations: it’s only useful while recompiling a single file. For other types of compilations, the process will end up running the actual compiler. The same thing happens if a compiler flag is not supported. The bright side is that in any event it will not interfere with the actual compilation and will not throw an error – just fall back to the actual compiler.

Читайте также:  What is lun in linux

and see how it works with an example.

Testing GNU C Compiler with a simple C++ Program

As an example, let’s use a simple C++ program that calculates the area of a rectangle after its length and width have been provided as inputs.

Open your favorite text editor and enter the following code, then save as area.cpp :

#include using namespace std; int main() < float length, width, area; cout > length; cout > width; area = length*width; cout

To compile the above code into an executable named area in the current working directory use the -o switch with g++:

If you want to take advantage of ccache, just prepend the above command with ccache, as follows:

Sample Output
Enter the length of the rectangle: 2.5 Now enter the width: 3.7 The area of the rectangle is: 9.25 

Don’t let this simple example make you think that ccache is not useful. You will come to know what a great tool ccache is when recompiling a large source code file. The same principle applies for C programs as well.

Summary

In this article we have explained how to install and use the GNU compilers for C and C++ in Fedora-based distributions.

In addition, we showed how to use a compiler cache to speed up recompilations of the same code. While you can refer to the online man pages for gcc and g++ for further options and examples, we look forward to hearing from you if you have any questions or comments.

Источник

Will I find only GNU command line tools in Ubuntu?

A couple well known command line tools exist in several versions depending on the Unix flavor (like sed, find, ld). I was wondering which versions are available in Ubuntu (I assume GNU for all but I’d like to confirm that)?

I think you’ll need to narrow this down. The different tools have different differences. For example, the -i option to sed works differently on GNU and BSD sed, certain options of find ( -delete and -not for example) are not available in non-GNU versions etc. It isn’t possible to answer this in a general way, only by listing differences of specific programs. As for 2, to my knowledge all GNU/Linux distributions will have the GNU tools, yes.

4 Answers 4

There are a few ways of interpreting your question so I’ll be explicit in my answers.

Are all command line applications in Ubuntu GNU projects?

Of course not, you can install whatever you like and there are many things that are part of Ubuntu or Debian directly that aren’t upstream.

What about the most the command-line applications that ship with Ubuntu?

coreutils makes up a vast swathe of these (and this is a GNU project — it’s what the GNU in GNU/Linux represents) but in order to be POSIX compliant, a system needs more than just coreutils .

Just in case you’re wondering what coreutils covers, here’s its package description:

 This package contains the basic file, shell and text manipulation utilities which are expected to exist on every operating system. Specifically, this package includes: arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit cut date dd df dir dircolors dirname du echo env expand expr factor false flock fmt fold groups head hostid id install join link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir runcon sha*sum seq shred sleep sort split stat stty sum sync tac tail tee test timeout touch tr true truncate tsort tty uname unexpand uniq unlink users vdir wc who whoami yes 

So are all POSIX commands GNU?

No. While Ubuntu does use GNU, it relies on a lot of non-GNU projects for its POSIX compliance.

Читайте также:  Драйвера для linux ati

I’ve covered which commands are POSIX before so with that list, we can quickly generate a list of packages and then grab all the project Homepage URLs from those packages. Even without visiting the URLs you can see that they’re not GNU (some are even overtly nonGNU).

$ apt-cache show $(for c in "admin alias ar asa at awk basename batch bc bg break c99 cal cat cd cflow chgrp chmod chown cksum cmp colon comm command compress continue cp crontab csplit ctags cut cxref date dd delta df diff dirname dot du echo ed env eval ex exec exit expand export expr false fc fg file find fold fort77 fuser gencat get getconf getopts grep hash head iconv id ipcrm ipcs jobs join kill lex link ln locale localedef logger logname lp ls m4 mailx make man mesg mkdir mkfifo more mv newgrp nice nl nm nohup od paste patch pathchk pax pr printf prs ps pwd qalter qdel qhold qmove qmsg qrerun qrls qselect qsig qstat qsub read readonly renice return rm rmdel rmdir sact sccs sed set sh shift sleep sort split strings strip stty tabs tail talk tee test time times touch tput tr trap true tsort tty type ulimit umask unalias uname uncompress unexpand unget uniq unlink unset uucp uudecode uuencode uustat uux val vi wait wc what who write xargs yacc zcat"; do dpkg -S $(readlink -f $(which $c)); done | awk -F: '' | sort -u) | awk '/Package|Homepage/' Package: at Package: bc Homepage: http://ftp.gnu.org/gnu/bc/ Package: binutils Package: bison Homepage: http://www.gnu.org/software/bison/ Package: bsdmainutils Package: bsdutils Homepage: http://userweb.kernel.org/~kzak/util-linux/ Package: coreutils Homepage: http://gnu.org/software/coreutils Package: cron Homepage: http://ftp.isc.org/isc/cron/ Package: cups-client Homepage: http://www.cups.org Package: dash Homepage: http://gondor.apana.org.au/~herbert/dash/ Package: diffutils Homepage: http://www.gnu.org/software/diffutils/ Package: ed Homepage: http://www.gnu.org/software/ed/ Package: file Homepage: http://www.darwinsys.com/file/ Package: findutils Homepage: http://savannah.gnu.org/projects/findutils/ Package: flex Homepage: http://flex.sf.net/ Package: gawk Homepage: http://www.gnu.org/software/gawk/ Package: gcc Package: graphviz Homepage: http://www.graphviz.org/ Package: grep Homepage: http://www.gnu.org/software/grep/ Package: gzip Package: heirloom-mailx Homepage: http://heirloom.sourceforge.net/mailx.html Package: libc-bin Homepage: http://www.eglibc.org Package: libc-dev-bin Homepage: http://www.eglibc.org Package: login Homepage: http://pkg-shadow.alioth.debian.org/ Package: m4 Homepage: http://www.gnu.org/software/m4/ Package: make Homepage: http://www.gnu.org/software/make/ Package: man-db Homepage: http://man-db.nongnu.org/ Package: ncurses-bin Homepage: http://invisible-island.net/ncurses/ Package: patch Package: pax Package: procps Homepage: http://gitorious.org/procps Package: psmisc Homepage: http://psmisc.sf.net/ Package: sed Homepage: http://www.gnu.org/software/sed/ Package: sharutils Homepage: http://www.gnu.org/software/sharutils/ Package: sysvinit-utils Homepage: http://savannah.nongnu.org/projects/sysvinit Package: time Homepage: http://www.gnu.org/software/time Package: util-linux Homepage: http://userweb.kernel.org/~kzak/util-linux/ Package: vim-tiny Homepage: http://www.vim.org/ 

Источник

Оцените статью
Adblock
detector