NetBSD Problem Report #52494

From www@NetBSD.org  Sun Aug 20 19:30:33 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id B0F987A17D
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 20 Aug 2017 19:30:33 +0000 (UTC)
Message-Id: <20170820193032.84E127A295@mollari.NetBSD.org>
Date: Sun, 20 Aug 2017 19:30:32 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@mylinuxisp.com
To: gnats-bugs@NetBSD.org
Subject: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
X-Send-Pr-Version: www-1.0

>Number:         52494
>Category:       pkg
>Synopsis:       ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 20 19:35:00 +0000 2017
>Closed-Date:    Tue Jun 19 01:51:04 +0000 2018
>Last-Modified:  Tue Jun 19 01:51:04 +0000 2018
>Originator:     John D. Baker
>Release:        NetBSD/i386-8.99.1, i386-8.0_BETA, pkgsrc-2017Q2
>Organization:
>Environment:
NetBSD verthandi 8.99.1 NetBSD 8.99.1 (VERTHANDI) #5: Fri Aug 18 12:12:32 CDT 2017  sysop@x3650.technoskunk.fur:/r1/build/current/obj/i386/sys/arch/i386/compile/VERTHANDI i386

>Description:
The various "ffmpeg" and related packages (*mplayer, mencoder) incur
text-relocation warnings/errors and attempt to set text segments
writable on i386 after PAX MPROTECT was enabled by default.

In the hope that these problems can be corrected, spurred in part by
this meta-discusion in "pkgsrc-changes":

  http://mail-index.netbsd.org/pkgsrc-changes/2017/08/19/msg161798.html

I've captured a build log of each of the "multimedia/ffmpeg*" packages
to which I've added:

  LDFLAGS+=     -Wl,--warn-shared-textrel

Hopefully relevant excerpts to be posted in followup messages.
>How-To-Repeat:
Attempt to run any of the 'ffmpeg' applications, or another application
that uses their libraries on i386-8.0_BETA or -8.99.1.
>Fix:

>Release-Note:

>Audit-Trail:
From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Sun, 20 Aug 2017 14:41:24 -0500 (CDT)

 Build log of "multimedia/ffmpeg010" reports:

 [...]
 LD      libavutil/libavutil.so.51
 ld: libavutil/aes.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavcodec/libavcodec.so.53
 ld: libavcodec/4xm.o: warning: relocation in readonly section `.text.unlikely'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]
 LD      libavformat/libavformat.so.53
 ld: libavformat/4xm.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]
 LD      libswresample/libswresample.so.0
 ld: libswresample/audioconvert.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]
 LD      libswscale/libswscale.so.2
 ld: libswscale/options.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavfilter/libavfilter.so.2
 ld: libavfilter/af_aconvert.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavdevice/libavdevice.so.53
 ld: libavdevice/alldevices.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]
 LD      libpostproc/libpostproc.so.52
 ld: libpostproc/postprocess.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]



 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Sun, 20 Aug 2017 14:46:25 -0500 (CDT)

 Build log of "multimedia/ffmpeg1" reports:

 [...]
 LD      libavutil/libavutil.so.52
 ld: libavutil/aes.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libswresample/libswresample.so.0
 ld: libswresample/audioconvert.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]
 LD      libavcodec/libavcodec.so.54
 ld: libavcodec/012v.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavformat/libavformat.so.54
 ld: libavformat/4xm.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 CC      libpostproc/postprocess.o
 LD      libpostproc/libpostproc.so.52
 ld: libpostproc/postprocess.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]
 LD      libswscale/libswscale.so.2
 ld: libswscale/input.o: warning: relocation in readonly section `.text.unlikely'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavfilter/libavfilter.so.3
 ld: libavfilter/af_aconvert.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavdevice/libavdevice.so.54
 ld: libavdevice/alldevices.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Sun, 20 Aug 2017 14:49:31 -0500 (CDT)

 Build log of "multimedia/ffmpeg2" reports:

 [...]
 LD      libavutil/libavutil.so.54
 ld: libavutil/aes.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libswscale/libswscale.so.3
 ld: libswscale/alphablend.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 CC      libpostproc/postprocess.o
 LD      libpostproc/libpostproc.so.53
 ld: libpostproc/postprocess.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]
 LD      libswresample/libswresample.so.1
 ld: libswresample/audioconvert.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavcodec/libavcodec.so.56
 ld: libavcodec/012v.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavformat/libavformat.so.56
 ld: libavformat/4xm.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavfilter/libavfilter.so.5
 ld: libavfilter/aeval.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavdevice/libavdevice.so.56
 ld: libavdevice/alldevices.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]


 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	jdbaker@mylinuxisp.com
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Sun, 20 Aug 2017 21:57:57 +0200

 On Sun, Aug 20, 2017 at 07:50:01PM +0000, John D. Baker wrote:
 >  Build log of "multimedia/ffmpeg2" reports:

 Can you check wrapper.log that they actually build with -fPIC? I
 remember a lot of "performance" hacks in this %$^$#%^ multimedia
 libraries and especially .rodata would strongly hint at that...

 Joerg

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Sun, 20 Aug 2017 15:21:21 -0500 (CDT)

 Build log of "multimedia/ffmpeg3" reports:

 [...]
 LD      libavutil/libavutil.so.55
 ld: libavutil/aes.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libswscale/libswscale.so.4
 ld: libswscale/alphablend.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 CC      libpostproc/postprocess.o
 GEN     libpostproc/libpostproc.ver
 LD      libpostproc/libpostproc.so.54
 ld: libpostproc/postprocess.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]
 LD      libswresample/libswresample.so.2
 ld: libswresample/audioconvert.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavcodec/libavcodec.so.57
 ld: libavcodec/012v.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavformat/libavformat.so.57
 ld: libavformat/3dostr.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavfilter/libavfilter.so.6
 ld: libavfilter/aeval.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 LD      libavdevice/libavdevice.so.57
 ld: libavdevice/alldevices.o: warning: relocation in readonly section `.text'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Sun, 20 Aug 2017 15:41:03 -0500 (CDT)

 On Sun, 20 Aug 2017, Joerg Sonnenberger wrote:

 >  On Sun, Aug 20, 2017 at 07:50:01PM +0000, John D. Baker wrote:
 >  >  Build log of "multimedia/ffmpeg2" reports:
 >  
 >  Can you check wrapper.log that they actually build with -fPIC? I
 >  remember a lot of "performance" hacks in this %$^$#%^ multimedia
 >  libraries and especially .rodata would strongly hint at that...

 I don't see a "wrapper.log" or ".wrapper.log" file in the WRKOBJDIR
 path for "ffmpeg2".  There is ".wrapper_makevars.mk", but I didn't
 see anything related to compiler/assembler options there.

 The ".work.log" file seems to contain compiler command invocations.
 The string "PIC" does _not_ appear anywhere in the file.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Sun, 20 Aug 2017 15:42:12 -0500 (CDT)

 For completeness, "multmedia/mplayer" build log reports:

 [...]
 ld: command.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Sun, 20 Aug 2017 15:58:42 -0500 (CDT)

 And similarly for "multimedia/gmplayer":

 [...]
 ld: command.o: warning: relocation in readonly section `.rodata'
 ld: warning: creating a DT_TEXTREL in a shared object.
 [...]

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Mon, 21 Aug 2017 04:32:01 +0000

 They're not built with -fPIC. but adding it with CFLAGS doesn't seem to
 be enough.

 I wouldn't be surprised if other operating systems made -fPIC the
 default and that's why they don't have the same issue, certainly
 Ubuntu now defaults to making PIE binaries and needs to explicit
 disable otherwise.

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	jdbaker@mylinuxisp.com
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Mon, 21 Aug 2017 10:42:33 +0200

 On Mon, Aug 21, 2017 at 04:35:01AM +0000, coypu@sdf.org wrote:
 >  I wouldn't be surprised if other operating systems made -fPIC the
 >  default and that's why they don't have the same issue, certainly
 >  Ubuntu now defaults to making PIE binaries and needs to explicit
 >  disable otherwise.

 Unlikely. They very likely just don't care about the text relocations.
 You know, "performance".

 Joerg

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52494: ffmpeg text relocations, i386-8.0_BETA, i386-8.99.1
Date: Tue, 20 Feb 2018 08:50:52 +0000

 On Mon, Aug 21, 2017 at 08:45:01AM +0000, Joerg Sonnenberger wrote:
  >  On Mon, Aug 21, 2017 at 04:35:01AM +0000, coypu@sdf.org wrote:
  >  >  I wouldn't be surprised if other operating systems made -fPIC the
  >  >  default and that's why they don't have the same issue, certainly
  >  >  Ubuntu now defaults to making PIE binaries and needs to explicit
  >  >  disable otherwise.
  >  
  >  Unlikely. They very likely just don't care about the text relocations.
  >  You know, "performance".

 There must be logic in the "build system" to choose not to use -fPIC
 based on machine, or it wouldn't work at all on amd64.

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 19 Jun 2018 01:51:04 +0000
State-Changed-Why:
Handled as PR pkg/53319


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.