cannot build shared libraries on Solaris

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

cannot build shared libraries on Solaris

Eric Thomas
Hello,



My system administrator downloaded the FFmpeg 4.1 source code this week,
and I have been trying to build a set of shared libraries in Solaris. I
have successfully

built the static libraries.



Here is some system info:



uname –a

     SunOS devm 5.10 Generic_150400-61 sun4u sparc SUNW,Sun-Fire-V490



make –v

     GNU Make 3.81



gcc –v

     Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs

     Configured with:
/sfw10/builds/build/sfw10-patch/usr/src/cmd/gcc/gcc-3.4.3/configure
–prefix=/usr/sfw –with-as=/usr/ccs/bin/as –without-gnu-as
–with-ld=/usr/ccs/bin/ld –without-gnu-ld –enable-language=c,c++
--enable-shared

     Thread model: posix

     gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)



sed –version

    GNU sed 4.5





Configure cmd

     bash ./configure –prefix=/home/ffmpeg/FFmpeg-4.1 -–enable-shared



Here is the console output, after running ‘make’, then ‘make V=1
ffmpeg’, then ‘make V=1 ffmpeg’ again:



gcc –shared –Wl,–h, libavutil.so. –Wl,-M,libavutil.ver –Llibavcodec
–Llibavdevice –Llibavfilter –Llibavformat –Llibavresample –Llibavutil
–Llibpostproc –Llibswscale –Llibswresample
–Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
–o libavutil/libavutil.so.
libavutil/../compat/atomics/pthread/stdatomic.o libavutil/adler32.o
libavutil/aes.o libavutil/aes_ctr.o libavutil/audio_fifo.o
libavutil/avstring.o libavutil/base64.o libavutil/blowfish.o
libavutil/bprint.o libavutil/buffer.o libavutil/camellia.o
libavutil/cast5.o libavutil/channel_layout.o libavutil/color_utils.o
libavutil/cpu.o libavutil/crc.o libavutil/des.o libavutil/dict.o
libavutil/display.o libavutil/downmix_info.o
libavutil/encryption_info.o libavutil/error.o libavutil/eval.o
libavutil/fifo.o libavutil/file.o libavutil/file_open.o
libavutil/fixed_dsp.o libavutil/float_dsp.o libavutil/frame.o
libavutil/hash.o libavutil/hmac.o libavutil/hwcontext.o
libavutil/imgutils.o libavutil/integer.o libavutil/intmath.o
libavutil/lfg.o libavutil/lls.o libavutil/log.o libavutil/log2_tab.o
libavutil/lzo.o libavutil/mastering_display_metadata.o
libavutil/mathematics.o libavutil/md5.o libavutil/mem.o
libavutil/murmur3.o libavutil/opt.o libavutil/parseutils.o
libavutil/pixdesc.o libavutil/pixelutils.o libavutil/random_seed.o
libavutil/rational.o libavutil/rc4.o libavutil/reverse.o
libavutil/ripemd.o libavutil/samplefmt.o libavutil/sha.o
libavutil/sha512.o libavutil/slicethread.o libavutil/spherical.o
libavutil/stereo3d.o libavutil/tea.o libavutil/threadmessage.o
libavutil/time.o libavutil/timecode.o libavutil/tree.o
libavutil/twofish.o libavutil/utils.o libavutil/xga_font_data.o
libavutil/xtea.o –lrt –pthread –lrt –lm

gcc: unrecognized option `-pthread’

Text relocation remains                              referenced

    against symbol                offset             in file

.data (section)                   0x0
libavutil/../compat/atomics/pthread/stdatomic.o

.data (section)                   0xc
libavutil/../compat/atomics/pthread/stdatomic.o

.data (section)                   0x14
libavutil/../compat/atomics/pthread/stdatomic.o

.data (section)                   0x20
libavutil/../compat/atomics/pthread/stdatomic.o

pthread_mutex_lock                0x4
libavutil/../compat/atomics/pthread/stdatomic.o

pthread_mutex_lock                0x8
libavutil/../compat/atomics/pthread/stdatomic.o

pthread_mutex_unlock              0x18
libavutil/../compat/atomics/pthread/stdatomic.o

pthread_mutex_unlock              0x1c
libavutil/../compat/atomics/pthread/stdatomic.o

ld: fatal: relocations remain against allocatable but non-writable sections

collect2: ld returned 1 exit status

make: *** [libavutil/libavutil.so.] Error 1





Can someone identify the problem?



Thanks!

Eric
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Carl Eugen Hoyos-2
2018-12-20 15:24 GMT+01:00, Eric Thomas <[hidden email]>:

> My system administrator downloaded the FFmpeg 4.1
> source code this week,

Sorry for being so nosy:
Does the following command not work for you?
$ curl -O http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
$ tar xf ffmpeg-snapshot.tar.bz2

(Above is a quick alternative to the more common
"git clone https://git.ffmpeg.org/ffmpeg.git")

I tested on sunos 5.11 with (default?) gcc 5.5 both
with your configure line and fate (our testing suite)
passes without issues.

--enable-shared --enable-gpl has an unrelated issue
here on Solaris, I'll send a patch to fix / workaround
this problem. (Sun ld doesn't understand -rpath-link
and searches "libpostproc.so" in "-link=libpostproc"
instead of "libpostproc".)

[...]

> Text relocation remains                              referenced
>
>     against symbol                offset             in file
>
> .data (section)                   0x0
> libavutil/../compat/atomics/pthread/stdatomic.o

Did you try the following?
$ rm compat/atomics/pthread/stdatomic.o && gmake ffmpeg

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Eric Thomas
Carl,

Removing the stdatomic.o file, and building with 'gmake' did the trick for
me. I
have a set of shared libraries. Thanks for that info!

Next question: On my Centos VM, my shared library files have the library
version as the filename suffix.
For example, "*libavcodec.so.58*".
On my Solaris machine, the library filenames do not have the version
suffix. For example, "*libavcodec.so.*"
Should the Solaris libraries have the version suffix? What edits can I make
to get the version suffix?

Thanks!
Eric

On Fri, Dec 21, 2018 at 6:09 PM Carl Eugen Hoyos <[hidden email]> wrote:

> 2018-12-20 15:24 GMT+01:00, Eric Thomas <[hidden email]>:
>
> > My system administrator downloaded the FFmpeg 4.1
> > source code this week,
>
> Sorry for being so nosy:
> Does the following command not work for you?
> $ curl -O http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
> $ tar xf ffmpeg-snapshot.tar.bz2
>
> (Above is a quick alternative to the more common
> "git clone https://git.ffmpeg.org/ffmpeg.git")
>
> I tested on sunos 5.11 with (default?) gcc 5.5 both
> with your configure line and fate (our testing suite)
> passes without issues.
>
> --enable-shared --enable-gpl has an unrelated issue
> here on Solaris, I'll send a patch to fix / workaround
> this problem. (Sun ld doesn't understand -rpath-link
> and searches "libpostproc.so" in "-link=libpostproc"
> instead of "libpostproc".)
>
> [...]
>
> > Text relocation remains                              referenced
> >
> >     against symbol                offset             in file
> >
> > .data (section)                   0x0
> > libavutil/../compat/atomics/pthread/stdatomic.o
>
> Did you try the following?
> $ rm compat/atomics/pthread/stdatomic.o && gmake ffmpeg
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Carl Eugen Hoyos-2
2018-12-24 14:20 GMT+01:00, Eric Thomas <[hidden email]>:

> Next question: On my Centos VM, my shared library files have the library
> version as the filename suffix.
> For example, "*libavcodec.so.58*".
> On my Solaris machine, the library filenames do not have the version
> suffix. For example, "*libavcodec.so.*"

I get version suffixes here:
$ ls -l libavcodec/libavcodec.*
lrwxrwxrwx   1 cehoyos  staff         16 Dec 27 21:58
libavcodec/libavcodec.so -> libavcodec.so.58
-rwxr-xr-x   1 cehoyos  staff    66379668 Dec 27 21:58
libavcodec/libavcodec.so.58
-rw-r--r--   1 cehoyos  staff      25622 Dec 27 21:58 libavcodec/libavcodec.ver
-rw-r--r--   1 cehoyos  staff         85 Dec 27 21:48
libavcodec/libavcodec.version

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Carl Eugen Hoyos-2
In reply to this post by Eric Thomas
2018-12-24 14:20 GMT+01:00, Eric Thomas <[hidden email]>:

> Removing the stdatomic.o file, and building with 'gmake' did
> the trick for me.

This may be a bug (did "make distclean" not remove the file?)
but since I cannot reproduce, I'll not try to fix it.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Carl Zwanzig
In reply to this post by Carl Eugen Hoyos-2
On 12/27/2018 1:00 PM, Carl Eugen Hoyos wrote:
> 2018-12-24 14:20 GMT+01:00, Eric Thomas<[hidden email]>:

>> On my Solaris machine, the library filenames do not have the version
>> suffix. For example, "*libavcodec.so.*"

> I get version suffixes here:
> $ ls -l libavcodec/libavcodec.*
> lrwxrwxrwx   1 cehoyos  staff         16 Dec 27 21:58
> libavcodec/libavcodec.so -> libavcodec.so.58
> -rwxr-xr-x   1 cehoyos  staff    66379668 Dec 27 21:58
> libavcodec/libavcodec.so.58

I seem to recall that solaris doesn't usually set up the "symlink to the
numbered lib" technique that BSD and linux use but I don't have a system to
check that.

Does solaris/illumos/etc use that technique?

z!
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Eric Thomas
In reply to this post by Carl Eugen Hoyos-2
Here is an example of what I have. The other libraries are similar (no
version numbers)..
find . -name *.so* | xargs ls -l
    ./libavcodec/libavcodec.so -> libavcodec.so.
    47462412 ./libavcodec/libavcodec.so.





On Thu, Dec 27, 2018 at 4:01 PM Carl Eugen Hoyos <[hidden email]> wrote:

> 2018-12-24 14:20 GMT+01:00, Eric Thomas <[hidden email]>:
>
> > Next question: On my Centos VM, my shared library files have the library
> > version as the filename suffix.
> > For example, "*libavcodec.so.58*".
> > On my Solaris machine, the library filenames do not have the version
> > suffix. For example, "*libavcodec.so.*"
>
> I get version suffixes here:
> $ ls -l libavcodec/libavcodec.*
> lrwxrwxrwx   1 cehoyos  staff         16 Dec 27 21:58
> libavcodec/libavcodec.so -> libavcodec.so.58
> -rwxr-xr-x   1 cehoyos  staff    66379668 Dec 27 21:58
> libavcodec/libavcodec.so.58
> -rw-r--r--   1 cehoyos  staff      25622 Dec 27 21:58
> libavcodec/libavcodec.ver
> -rw-r--r--   1 cehoyos  staff         85 Dec 27 21:48
> libavcodec/libavcodec.version
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Eric Thomas
In reply to this post by Carl Eugen Hoyos-2
Carl,

"make distclean" does not remove the compat/atomics/pthread/stdatomic.o
file on my system.

Eric

On Thu, Dec 27, 2018 at 4:11 PM Carl Eugen Hoyos <[hidden email]> wrote:

> 2018-12-24 14:20 GMT+01:00, Eric Thomas <[hidden email]>:
>
> > Removing the stdatomic.o file, and building with 'gmake' did
> > the trick for me.
>
> This may be a bug (did "make distclean" not remove the file?)
> but since I cannot reproduce, I'll not try to fix it.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Reindl Harald


Am 28.12.18 um 12:25 schrieb Eric Thomas:
> "make distclean" does not remove the compat/atomics/pthread/stdatomic.o
> file on my system.

i recommend doing the same as package builds

* rm -rf buildroot
* mkdir buildroot
* configure && make

sample for a newer, static php binary on CentOS below which i need for
letsencrypt libraries using PHP 7.1 features

--------------

[builduser@backup-hosting:~]$ ls
insgesamt 20K
drwx------ 2 builduser builduser 4,0K 2018-04-10 16:58 BINARIES
drwx------ 2 builduser builduser 4,0K 2018-04-10 16:58 BUILD
drwx------ 2 builduser builduser 4,0K 2018-04-10 16:58 BUILDROOTS
drwx------ 2 builduser builduser 4,0K 2018-07-21 04:58 SOURCES
-rwx------ 1 builduser builduser 1,8K 2018-04-10 16:51 build-php-cli.sh

[builduser@backup-hosting:~]$ cat build-php-cli.sh
#!/usr/bin/bash
PHP_VERSION="7.2.12"
rm -rf /home/builduser/BUILDROOTS/php-$PHP_VERSION
tar xfJ /home/builduser/SOURCES/php-$PHP_VERSION.tar.xz -C
/home/builduser/BUILDROOTS/
cd /home/builduser/BUILDROOTS/php-$PHP_VERSION
export CFLAGS="-m64 -Os -mfpmath=sse -mavx -msse2avx -march=native
-mtune=native -ftree-vectorize -fomit-frame-pointer -fno-strict-aliasing
-fwrapv -g0"
export CC="gcc $CFLAGS"
export CXXFLAGS="$CFLAGS"
export CPPFLAGS="$CFLAGS"
export CXX="gcc $CFLAGS"
./configure --quiet \
 --host=x86_64-redhat-linux \
 --build=x86_64-redhat-linux \
 --target=x86_64-redhat-linux \
 --prefix=/home/builduser/BUILD \
 --program-prefix= \
 --disable-all \
 --enable-calendar \
 --enable-cli \
 --enable-ctype \
 --enable-dom \
 --enable-filter \
 --enable-hash \
 --enable-intl \
 --enable-json \
 --enable-libxml \
 --enable-mbregex \
 --enable-mbstring \
 --enable-posix \
 --enable-simplexml \
 --enable-soap \
 --enable-static \
 --enable-xml \
 --with-curl \
 --with-iconv \
 --with-layout=GNU \
 --with-openssl \
 --with-pcre-regex \
 --with-system-ciphers \
 --with-zlib \
 --without-apxs2 \
 --without-config-file-path \
 --without-config-file-scan-dir \
 --without-pcre-jit \
 --disable-cgi \
 --disable-dmalloc \
 --disable-dtrace \
 --disable-gcov \
 --disable-ipv6 \
 --disable-phpdbg \
 --disable-rpath \
 --disable-shared \
 --disable-short-tags
make --quiet -j4
make install
strip -s --strip-unneeded /home/builduser/BUILD/bin/php
mv --force /home/builduser/BUILD/bin/php /home/builduser/BINARIES/
rm -rf /home/builduser/BUILD/*
rm -rf /home/builduser/BUILDROOTS/php-$PHP_VERSION
chmod 755 /home/builduser/BINARIES/php
ls /home/builduser/BINARIES/php
echo ""
/home/builduser/BINARIES/php -v
echo ""
/home/builduser/BINARIES/php -m
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Carl Eugen Hoyos-2
In reply to this post by Eric Thomas
2018-12-28 12:19 GMT+01:00, Eric Thomas <[hidden email]>:
> Here is an example of what I have. The other libraries are similar (no
> version numbers)..
> find . -name *.so* | xargs ls -l
>     ./libavcodec/libavcodec.so -> libavcodec.so.
>     47462412 ./libavcodec/libavcodec.so.

I suspect this is related to your shell, try:
$ ffbuild/libversion.sh avutil libavutil/version.h
libavutil_VERSION=56.25.100
libavutil_VERSION_MAJOR=56
libavutil_VERSION_MINOR=25
This is my output, I expect your output will not show the numbers.

This is a bug that could be fixed but given that sunos is a very
unusual target and I cannot reproduce here, my guess is that
you can somehow convince your build environment to use
bash instead of the Solaris shell...

If you need more support, please find out what top-posting
means and avoid it here.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Carl Eugen Hoyos-2
In reply to this post by Eric Thomas
2018-12-28 12:19 GMT+01:00, Eric Thomas <[hidden email]>:
> Here is an example of what I have. The other libraries are similar (no
> version numbers)..
> find . -name *.so* | xargs ls -l
>     ./libavcodec/libavcodec.so -> libavcodec.so.
>     47462412 ./libavcodec/libavcodec.so.

I suspect this is related to your shell, try:
$ ffbuild/libversion.sh avutil libavutil/version.h
libavutil_VERSION=56.25.100
libavutil_VERSION_MAJOR=56
libavutil_VERSION_MINOR=25
This is my output, I expect your output will not show the numbers.

This is a bug that could be fixed but given that sunos is a very
unusual target and I cannot reproduce here, my guess is that
you can somehow convince your build environment to use
bash instead of the Solaris shell...

If you need more support, please find out what top-posting
means and avoid it here.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Eric Thomas
 My results:

$ ffbuild/libversion.sh avutil libavutil/version.h
libavutil_VERSION=56.22.100
libavutil_VERSION_MAJOR=56
libavutil_VERSION_MINOR=22



On Fri, Dec 28, 2018 at 7:55 AM Carl Eugen Hoyos <[hidden email]> wrote:

> 2018-12-28 12:19 GMT+01:00, Eric Thomas <[hidden email]>:
> > Here is an example of what I have. The other libraries are similar (no
> > version numbers)..
> > find . -name *.so* | xargs ls -l
> >     ./libavcodec/libavcodec.so -> libavcodec.so.
> >     47462412 ./libavcodec/libavcodec.so.
>
> I suspect this is related to your shell, try:
> $ ffbuild/libversion.sh avutil libavutil/version.h
> libavutil_VERSION=56.25.100
> libavutil_VERSION_MAJOR=56
> libavutil_VERSION_MINOR=25
> This is my output, I expect your output will not show the numbers.
>
> This is a bug that could be fixed but given that sunos is a very
> unusual target and I cannot reproduce here, my guess is that
> you can somehow convince your build environment to use
> bash instead of the Solaris shell...
>
> If you need more support, please find out what top-posting
> means and avoid it here.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: cannot build shared libraries on Solaris

Carl Eugen Hoyos-2
In reply to this post by Eric Thomas
2018-12-28 12:25 GMT+01:00, Eric Thomas <[hidden email]>:

> "make distclean" does not remove the compat/atomics/pthread/stdatomic.o
> file on my system.

Should be fixed, thank you for the reminder.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".