Discussion:
[libusb] Dependency on gcc
Phani Kumar
2017-03-28 14:53:49 UTC
Permalink
Hi

I am trying to build libusb package but unable to get away with the
dependency on gcc when i am trying to install the package on another
machine. When i run the binary like listdevs or xusb I get failed to load
library error.

Can you please tell me what compilation flags or what configure options i
need to provide to get away with it.

# ldd ./BUILD/libusb-1.0.19/libusb/.libs/libusb-1.0.so.0

./BUILD/libusb-1.0.19/libusb/.libs/libusb-1.0.so.0 needs:
/opt/lib/libgcc_s.a(shr.o)
/usr/lib/libpthread.a(shr_xpg5.o)
/usr/lib/libc.a(shr.o)
/usr/lib/libpthreads.a(shr_comm.o)
/usr/lib/libcrypt.a(shr.o)

I dont want dependency on libgcc_s.a Please help

Regards
Phani
.
Robert Heller
2017-03-28 16:26:41 UTC
Permalink
Post by Phani Kumar
Hi
I am trying to build libusb package but unable to get away with the
dependency on gcc when i am trying to install the package on another
machine. When i run the binary like listdevs or xusb I get failed to load
library error.
Can you please tell me what compilation flags or what configure options i
need to provide to get away with it.
# ldd ./BUILD/libusb-1.0.19/libusb/.libs/libusb-1.0.so.0
/opt/lib/libgcc_s.a(shr.o)
/usr/lib/libpthread.a(shr_xpg5.o)
/usr/lib/libc.a(shr.o)
/usr/lib/libpthreads.a(shr_comm.o)
/usr/lib/libcrypt.a(shr.o)
I dont want dependency on libgcc_s.a Please help
If you use the gcc compiler you *have* to use libgcc_s or something like it.
The only exception would be embeded systems or a non-UNIX (Linux/BSD) target
like MS-Windows. Since the file name is a *Linux* shared file
(*.so.<numbers>), it is presumed that the target is a Linux system. libgcc_s
is pretty much required by any Linux system. On my CentOS 6 system doing
"ldd /usr/bin/* | grep libgcc" lists *hundreds* of lines like:

libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003df0200000)

Basically, just about every binary program in /usr/bin references
libgcc_s.so.1 (I don't know why your listing is showing libgcc_s.a -- that
sounds like something is odd in your build environment).
Post by Phani Kumar
Regards
Phani
.
MIME-Version: 1.0
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
MIME-Version: 1.0
_______________________________________________
libusb-devel mailing list
https://lists.sourceforge.net/lists/listinfo/libusb-devel
--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
***@deepsoft.com -- Webhosting Services
David Grayson
2017-03-28 17:05:15 UTC
Permalink
It is possible to make a GCC toolchain that uses musl instead of glibc and
produces statically-linked binaries that don't depend on any shared
objects. The executables can then be run on any Linux system with the same
architecture. If you search around for something like "gcc musl static
cross-compiler" you will probably find a tutorial on that.

If you're just compiling a program the normal GCC on a standard Linux
environment, your executable will depend on system libraries like libc and
libgcc, because that allows your system to save a lot of disk space and
RAM. Copying such an executable to another system might not work if its
shared libraries are different.

--David
Post by Robert Heller
Post by Phani Kumar
Hi
I am trying to build libusb package but unable to get away with the
dependency on gcc when i am trying to install the package on another
machine. When i run the binary like listdevs or xusb I get failed to load
library error.
Can you please tell me what compilation flags or what configure options i
need to provide to get away with it.
# ldd ./BUILD/libusb-1.0.19/libusb/.libs/libusb-1.0.so.0
/opt/lib/libgcc_s.a(shr.o)
/usr/lib/libpthread.a(shr_xpg5.o)
/usr/lib/libc.a(shr.o)
/usr/lib/libpthreads.a(shr_comm.o)
/usr/lib/libcrypt.a(shr.o)
I dont want dependency on libgcc_s.a Please help
If you use the gcc compiler you *have* to use libgcc_s or something like it.
The only exception would be embeded systems or a non-UNIX (Linux/BSD) target
like MS-Windows. Since the file name is a *Linux* shared file
(*.so.<numbers>), it is presumed that the target is a Linux system.
libgcc_s
is pretty much required by any Linux system. On my CentOS 6 system doing
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003df0200000)
Basically, just about every binary program in /usr/bin references
libgcc_s.so.1 (I don't know why your listing is showing libgcc_s.a -- that
sounds like something is odd in your build environment).
Post by Phani Kumar
Regards
Phani
.
MIME-Version: 1.0
------------------------------------------------------------
------------------
Post by Phani Kumar
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
MIME-Version: 1.0
_______________________________________________
libusb-devel mailing list
https://lists.sourceforge.net/lists/listinfo/libusb-devel
--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
libusb-devel mailing list
https://lists.sourceforge.net/lists/listinfo/libusb-devel
Loading...