Discussion:
Link against system libs
(too old to reply)
Wolfgang Mader
2017-04-06 12:13:06 UTC
Permalink
Raw Message
Hi all,

I have a general question about linking in C++ with which you can probably
clarify for me.

Arch ships with a lot of libraries of which .a and .so are stored in /usr/lib
and beyond. These libraries are compiled by some compiler, the compiler by
which the entire arch linux distribution packages are compiled with. By the
way, which one is this and where can I find that information.

If this compiler is a c++ one, it does its specific name mangling. Thus,
linking against these libs should only be possible for binaries compiled with
the same c++ compiler. However, arch ships gcc6, gcc5, and clang. Does it also
ship libraries for all these compilers or how is it possible for binaries
complied by these different compilers to link successfully?

Best,
Wolfgang
Martin Kühne via arch-general
2017-04-06 12:37:15 UTC
Permalink
Raw Message
On Thu, Apr 6, 2017 at 2:13 PM, Wolfgang Mader
Post by Wolfgang Mader
Arch ships with a lot of libraries of which .a and .so are stored in /usr/lib
and beyond. These libraries are compiled by some compiler, the compiler by
which the entire arch linux distribution packages are compiled with. By the
way, which one is this and where can I find that information.
If this compiler is a c++ one, it does its specific name mangling. Thus,
linking against these libs should only be possible for binaries compiled with
the same c++ compiler. However, arch ships gcc6, gcc5, and clang. Does it also
ship libraries for all these compilers or how is it possible for binaries
complied by these different compilers to link successfully?
All of a program's interactions with the operating system as well as
the subordinate interactions between different units of code and data
are subject to the linker and loader. The file format as well as
interaction "platform" which Arch uses is called ELF. Both GCC and
LLVM produce valid ELF binaries as well as libraries which are
normally used with Linux. The kernel build configuration offers other
formats too, though. Essentially, you can have units produced by
different compilers and even on different machines, but then go run
them together without problems because organizing the different units
at the many different layers that accumulated here is better not left
up to the compiler itself, but rather this formal definition of how
things interact with each other.

cheers!
mar77i
Martin Kühne via arch-general
2017-04-06 12:45:19 UTC
Permalink
Raw Message
Also, I forgot to add some literature on the subject, too. [0], [1], [2]

cheers!
mar77i

[0] https://linux.die.net/man/8/ld-linux
[1] http://www.linuxjournal.com/node/6463/print
[2] http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
Wolfgang Mader
2017-04-07 07:16:08 UTC
Permalink
Raw Message
On Donnerstag, 6. April 2017 14:45:19 CEST Martin Kühne via arch-general
Post by Martin Kühne via arch-general
Also, I forgot to add some literature on the subject, too. [0], [1], [2]
cheers!
mar77i
[0] https://linux.die.net/man/8/ld-linux
[1] http://www.linuxjournal.com/node/6463/print
[2] http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
Thanks, this cleared things up!

Best,
Wolfgang
Lukas Jirkovsky via arch-general
2017-04-06 12:50:13 UTC
Permalink
Raw Message
Post by Wolfgang Mader
If this compiler is a c++ one, it does its specific name mangling. Thus,
linking against these libs should only be possible for binaries compiled with
the same c++ compiler. However, arch ships gcc6, gcc5, and clang. Does it also
ship libraries for all these compilers or how is it possible for binaries
complied by these different compilers to link successfully?
Best,
Wolfgang
All compilers you mentioned are for the most part ABI compatible, ie.
they use the same name mangling.
Neven Sajko via arch-general
2017-04-07 04:07:37 UTC
Permalink
Raw Message
GCC 6 builds Archlinux.
Neven Sajko via arch-general
2017-04-07 04:16:20 UTC
Permalink
Raw Message
Post by Neven Sajko via arch-general
GCC 6 builds Archlinux.
It's in the base-devel group btw, along with other packages generally
required for building:
https://www.archlinux.org/groups/x86_64/base-devel/

Also, you might want to read the makepkg page on wiki.archlinux.org.

And you can use asp https://aur.archlinux.org/packages/asp-git/ for
downloading the official repo buildscripts.
Ralf Mardorf
2017-04-07 07:21:47 UTC
Permalink
Raw Message
Post by Neven Sajko via arch-general
And you can use asp https://aur.archlinux.org/packages/asp-git/ for
downloading the official repo buildscripts.
Just that asp is from AUR which isn't an official repository. ABS is in
the official Extra repository,
https://wiki.archlinux.org/index.php/Arch_Build_System .

Regards,
Ralf
Martin Kühne via arch-general
2017-04-07 07:35:08 UTC
Permalink
Raw Message
Post by Ralf Mardorf
Just that asp is from AUR which isn't an official repository. ABS is in
the official Extra repository,
https://wiki.archlinux.org/index.php/Arch_Build_System .
Except the reason for that is that arch doesn't need to distribute
that software officially because mostly the people who use it use it
to provide the official distribution with it. It's somewhat a chicken
and egg question. Now that you had to to point out that the software
used to build the official repository is distributed inofficially,
wouldn't that, with the same logic, make the whole distribution
inofficial? Why are we drawing a line there?

cheers!
mar77i
Ralf Mardorf
2017-04-07 08:04:42 UTC
Permalink
Raw Message
It's somewhat a chicken and egg question.
So it's not a problem, a chicken already exists, you could release it by
official repositories.
And you can use asp https://aur.archlinux.org/packages/asp-git/ for
downloading the official repo buildscripts.
You also could do this with ABS.

I'm not against asp, I only want to point out that downloading the
official PKGBUILDS could be done with a tool from an official
repository.
Martin Kühne via arch-general
2017-04-07 08:07:12 UTC
Permalink
Raw Message
You don't appear to follow arch-dev-public [0] very closely, do you.

cheers!
mar77i

[0] https://lists.archlinux.org/pipermail/arch-dev-public/2017-March/028752.html
Ralf Mardorf
2017-04-07 08:21:18 UTC
Permalink
Raw Message
Post by Martin Kühne via arch-general
You don't appear to follow arch-dev-public [0] very closely, do you.
This was mentioned a few days back on this mailing list, too.
What's your point?
Post by Martin Kühne via arch-general
https://lists.archlinux.org/pipermail/arch-dev-public/2017-March/028752.html
To get access to the latest official PKGBUILDS ABS works and it could
be installed from Extra. There's no need to build something from AUR.

[***@archlinux ~]$ grep pkgver /var/abs/core/linux/PKGBUILD |
head -1 pkgver=4.10.8
[***@archlinux ~]$ grep pkgrel /var/abs/core/linux/PKGBUILD |
head -1 pkgrel=1
[***@archlinux ~]$ pacman -Si linux | grep Version
Version : 4.10.8-1

Again, I'm not against asp, but why not simply installing ABS from
extra at the moment, instead of asp from AUR?

I don't get your point. Why do you make such a big off-topic discussion
out of it?
Ralf Mardorf
2017-04-07 08:24:03 UTC
Permalink
Raw Message
Post by Ralf Mardorf
Post by Martin Kühne via arch-general
You don't appear to follow arch-dev-public [0] very closely, do you.
This was mentioned a few days back on this mailing list, too.
What's your point?
Post by Martin Kühne via arch-general
https://lists.archlinux.org/pipermail/arch-dev-public/2017-March/028752.html
To get access to the latest official PKGBUILDS ABS works and it could
be installed from Extra. There's no need to build something from AUR.
head -1 pkgver=4.10.8
head -1 pkgrel=1
Version : 4.10.8-1
I forgot the important date.

[***@archlinux ~]$ pacman -Si linux | grep Build\ Date
Build Date : Fri 31 Mar 2017 04:51:56 PM CEST
Post by Ralf Mardorf
Again, I'm not against asp, but why not simply installing ABS from
extra at the moment, instead of asp from AUR?
I don't get your point. Why do you make such a big off-topic discussion
out of it?
Eli Schwartz via arch-general
2017-04-07 13:24:16 UTC
Permalink
Raw Message
Post by Ralf Mardorf
Post by Martin Kühne via arch-general
You don't appear to follow arch-dev-public [0] very closely, do you.
This was mentioned a few days back on this mailing list, too.
What's your point?
Post by Martin Kühne via arch-general
https://lists.archlinux.org/pipermail/arch-dev-public/2017-March/028752.html
To get access to the latest official PKGBUILDS ABS works and it could
be installed from Extra. There's no need to build something from AUR.
The point is that ABS is unmaintained, might *not* work, is *known* to
have not-worked quite recently, and will eventually be removed
altogether (at which point asp will get an official release and be moved
to extra). Whereas asp works quite well and gets you a lot more than ABS
in the process.

But mostly, because people seeking to download PKGBUILDs clearly have no
problem using AUR packages in the general sense. So there is absolutely
no need to suggest *inferior solutions* and justify them because "it's
provided in an official repo"...
--
Eli Schwartz
Ralf Mardorf
2017-04-07 13:39:13 UTC
Permalink
Raw Message
Post by Eli Schwartz via arch-general
The point is that ABS is unmaintained, might *not* work, is *known* to
have not-worked quite recently, and will eventually be removed
altogether
Until now it works when just running "abs" and isn't removed. It might
not work well if you run "abs [options] [repository1[/package1]
[repository2[/package2] ...]]", however my point simply is [1].

I thought everything was already pointed out. It's off-topic and just
bikeshedding to repeat the same opinions. I explained my intension,
Martti posted the link
https://lists.archlinux.org/pipermail/arch-dev-public/2017-March/028752.html
so everything is already said, no need to continue. The readers already
know the pros and cons and could decide on their own.

Some of us continued off-list ;), this at least doesn't hijack the
thread.

Regards,
Ralf

[1]
Begin forwarded off-list message:

Date: Fri, 7 Apr 2017 10:52:00 +0200
From: Ralf Mardorf <***@alice-dsl.net>
To:
Subject: Re: [arch-general] Link against system libs

[snip]

Just running

$ sudo abs

works and provides what is wanted in the context of the thread.
You could install it by running

$ sudo pacman -S abs

IOW you don't need to download a tarball, extract it, change into the
directory and then run makepkg -s or -si.

Eli Schwartz via arch-general
2017-04-07 13:24:20 UTC
Permalink
Raw Message
Post by Martin Kühne via arch-general
Post by Ralf Mardorf
Just that asp is from AUR which isn't an official repository. ABS is in
the official Extra repository,
https://wiki.archlinux.org/index.php/Arch_Build_System .
Except the reason for that is that arch doesn't need to distribute
that software officially because mostly the people who use it use it
to provide the official distribution with it. It's somewhat a chicken
and egg question. Now that you had to to point out that the software
used to build the official repository is distributed inofficially,
wouldn't that, with the same logic, make the whole distribution
inofficial? Why are we drawing a line there?
Actually, the official repositories use neither ABS or asp for building,
and it is ridiculous to suggest they do... not least because neither
provide a way to upload anything.

The official repos use devtools, which is in fact in the official repos.
And it is backed by svn: https://www.archlinux.org/svn/

ABS (backed by tar/rsync) and asp (backed by svntogit) are both
read-only mirrors provided for people who aren't Devs/TUs.
--
Eli Schwartz
Loading...