Re: on clang-archs: watch out for '-e xport-dynamic' warnings

2017-12-25 Thread Jeremie Courreges-Anglas
On Mon, Dec 25 2017, Jan Beich  wrote:
> Jeremie Courreges-Anglas  writes:
>
>> +--- src/Makefile.am.orig
>>  src/Makefile.am
>> +@@ -24,5 +24,6 @@ AM_CPPFLAGS = @PACKAGE_CFLAGS@ \
>> +-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
>> +-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
>> + 
>> +-AM_CFLAGS = -export-dynamic -Wall
>> ++AM_CFLAGS = -Wall
>> ++AM_LDAGS = -rdynamic
> ^^
> Did you mean AM_LDFLAGS instead?

Fixed, thanks.

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: on clang-archs: watch out for '-e xport-dynamic' warnings

2017-12-25 Thread Jan Beich
Jeremie Courreges-Anglas  writes:

> +--- src/Makefile.am.orig
>  src/Makefile.am
> +@@ -24,5 +24,6 @@ AM_CPPFLAGS = @PACKAGE_CFLAGS@ \
> + -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
> + -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
> + 
> +-AM_CFLAGS = -export-dynamic -Wall
> ++AM_CFLAGS = -Wall
> ++AM_LDAGS = -rdynamic
^^
Did you mean AM_LDFLAGS instead?



Re: on clang-archs: watch out for '-e xport-dynamic' warnings

2017-12-22 Thread Pierre-Emmanuel Andre
On Fri, Dec 22, 2017 at 09:47:51PM +0100, Matthias Kilian wrote:
> Hi,
> 
> On Fri, Dec 22, 2017 at 12:22:58AM +0100, Jeremie Courreges-Anglas wrote:
> > Fix for klavaro, which is affected by the same problems as audio/tagtool
> > and editors/gummi.  The diff below patches both Makefile.am (could be
> > upstreamed?) and Makefile.in (to avoid bringing in automake).
> > 
> > ok?
> 
> Fine for me if pea@ doesn't object. But please add a comment to the
> Makefile.am patch that it's only there to be sent to upstream.
>

Fine with me too.


> Ciao,
>   Kili
> 
> 
> > Index: Makefile
> > ===
> > RCS file: /d/cvs/ports/x11/klavaro/Makefile,v
> > retrieving revision 1.17
> > diff -u -p -r1.17 Makefile
> > --- Makefile28 Aug 2016 17:22:29 -  1.17
> > +++ Makefile21 Dec 2017 21:47:57 -
> > @@ -3,7 +3,7 @@
> >  COMMENT =  touch typing tutor program
> >  
> >  DISTNAME = klavaro-1.5.0
> > -REVISION = 6
> > +REVISION = 7
> >  
> >  CATEGORIES =   x11
> >  
> > Index: patches/patch-src_Makefile_am
> > ===
> > RCS file: patches/patch-src_Makefile_am
> > diff -N patches/patch-src_Makefile_am
> > --- /dev/null   1 Jan 1970 00:00:00 -
> > +++ patches/patch-src_Makefile_am   21 Dec 2017 22:19:11 -
> > @@ -0,0 +1,15 @@
> > +$OpenBSD$
> > +
> > +Fix passing --export-dynamic to the linker.
> > +
> > +Index: src/Makefile.am
> > +--- src/Makefile.am.orig
> >  src/Makefile.am
> > +@@ -24,5 +24,6 @@ AM_CPPFLAGS = @PACKAGE_CFLAGS@ \
> > +   -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
> > +   -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
> > + 
> > +-AM_CFLAGS = -export-dynamic -Wall
> > ++AM_CFLAGS = -Wall
> > ++AM_LDAGS = -rdynamic
> > + 
> > Index: patches/patch-src_Makefile_in
> > ===
> > RCS file: patches/patch-src_Makefile_in
> > diff -N patches/patch-src_Makefile_in
> > --- /dev/null   1 Jan 1970 00:00:00 -
> > +++ patches/patch-src_Makefile_in   21 Dec 2017 22:19:11 -
> > @@ -0,0 +1,17 @@
> > +$OpenBSD$
> > +
> > +Fix passing --export-dynamic to the linker.
> > +
> > +Index: src/Makefile.in
> > +--- src/Makefile.in.orig
> >  src/Makefile.in
> > +@@ -194,7 +194,8 @@ AM_CPPFLAGS = @PACKAGE_CFLAGS@ \
> > +   -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
> > +   -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
> > + 
> > +-AM_CFLAGS = -export-dynamic -Wall
> > ++AM_CFLAGS = -Wall
> > ++AM_LDFLAGS = -rdynamic
> > + all: all-am
> > + 
> > + .SUFFIXES:
> > 
> > -- 
> > jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
> 



Re: on clang-archs: watch out for '-e xport-dynamic' warnings

2017-12-22 Thread Matthias Kilian
Hi,

On Fri, Dec 22, 2017 at 12:22:58AM +0100, Jeremie Courreges-Anglas wrote:
> Fix for klavaro, which is affected by the same problems as audio/tagtool
> and editors/gummi.  The diff below patches both Makefile.am (could be
> upstreamed?) and Makefile.in (to avoid bringing in automake).
> 
> ok?

Fine for me if pea@ doesn't object. But please add a comment to the
Makefile.am patch that it's only there to be sent to upstream.

Ciao,
Kili


> Index: Makefile
> ===
> RCS file: /d/cvs/ports/x11/klavaro/Makefile,v
> retrieving revision 1.17
> diff -u -p -r1.17 Makefile
> --- Makefile  28 Aug 2016 17:22:29 -  1.17
> +++ Makefile  21 Dec 2017 21:47:57 -
> @@ -3,7 +3,7 @@
>  COMMENT =touch typing tutor program
>  
>  DISTNAME =   klavaro-1.5.0
> -REVISION =   6
> +REVISION =   7
>  
>  CATEGORIES = x11
>  
> Index: patches/patch-src_Makefile_am
> ===
> RCS file: patches/patch-src_Makefile_am
> diff -N patches/patch-src_Makefile_am
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ patches/patch-src_Makefile_am 21 Dec 2017 22:19:11 -
> @@ -0,0 +1,15 @@
> +$OpenBSD$
> +
> +Fix passing --export-dynamic to the linker.
> +
> +Index: src/Makefile.am
> +--- src/Makefile.am.orig
>  src/Makefile.am
> +@@ -24,5 +24,6 @@ AM_CPPFLAGS = @PACKAGE_CFLAGS@ \
> + -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
> + -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
> + 
> +-AM_CFLAGS = -export-dynamic -Wall
> ++AM_CFLAGS = -Wall
> ++AM_LDAGS = -rdynamic
> + 
> Index: patches/patch-src_Makefile_in
> ===
> RCS file: patches/patch-src_Makefile_in
> diff -N patches/patch-src_Makefile_in
> --- /dev/null 1 Jan 1970 00:00:00 -
> +++ patches/patch-src_Makefile_in 21 Dec 2017 22:19:11 -
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +
> +Fix passing --export-dynamic to the linker.
> +
> +Index: src/Makefile.in
> +--- src/Makefile.in.orig
>  src/Makefile.in
> +@@ -194,7 +194,8 @@ AM_CPPFLAGS = @PACKAGE_CFLAGS@ \
> + -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
> + -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
> + 
> +-AM_CFLAGS = -export-dynamic -Wall
> ++AM_CFLAGS = -Wall
> ++AM_LDFLAGS = -rdynamic
> + all: all-am
> + 
> + .SUFFIXES:
> 
> -- 
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: on clang-archs: watch out for '-e xport-dynamic' warnings

2017-12-21 Thread Jeremie Courreges-Anglas
On Thu, Dec 21 2017, Jeremie Courreges-Anglas  wrote:
> On Thu, Dec 21 2017, Matthias Kilian  wrote:
>> Hi,
>>
>> I just got a bug report from Sebastian Neuper about editors/gummi
>> misbehaving when built with clang. Details about the bug aren't
>> important, but he well-spooted this one in the build log:
>>
>> cc: warning: argument unused during compilation: '-e xport-dynamic' 
>> [-Wunused-command-line-argument]
>>
>> He also reported that using GCC did fix the problem (not only the
>> warning).

IIUC gcc passes -export-dynamic to ld(1) not because it recognizes the
keyword explicitely, but because of LINK_COMMAND_SPEC which contains
"%{e*}".  The spec matches "-e _symbol" but also "-export-dynamic",
which end sup doing the right thing.

Upstream gcc noticed the this quirk and explicitely added support
for -export-dynamic:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47390

clang passes "-e xport-dynamic" to ld(1) which interprets it as a bogus
entry point.  This breaks libglade[1].

>> Looking at my build logs (only a few, because I run dpb -uR), I
>> noticed some other ports producing this warning, and they invoke
>> gcc with the flag -export-dynamic. Which is wrong.
>>
>> When using gcc(1), -rdynamic should be used to pass -export-dynamic
>> to the linker (so says the man page).
>>
>> When using clang(1) -rdynamic can be used to pass -export-dynamic
>> to eh linker (so says jca@ on icb after having a look at the clang
>> sources).

Yep, it's probably the easiest way to fix those issues.  The alternative
would be to handle -export-dynamic like recent gcc versions do.
Also there seems to be a bad handling of -export-dynamic by libtool
(base and gnu), need to confirm.

Fix for klavaro, which is affected by the same problems as audio/tagtool
and editors/gummi.  The diff below patches both Makefile.am (could be
upstreamed?) and Makefile.in (to avoid bringing in automake).

ok?

[1] https://developer.gnome.org/libglade/unstable/libglade-notes.html


Index: Makefile
===
RCS file: /d/cvs/ports/x11/klavaro/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- Makefile28 Aug 2016 17:22:29 -  1.17
+++ Makefile21 Dec 2017 21:47:57 -
@@ -3,7 +3,7 @@
 COMMENT =  touch typing tutor program
 
 DISTNAME = klavaro-1.5.0
-REVISION = 6
+REVISION = 7
 
 CATEGORIES =   x11
 
Index: patches/patch-src_Makefile_am
===
RCS file: patches/patch-src_Makefile_am
diff -N patches/patch-src_Makefile_am
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-src_Makefile_am   21 Dec 2017 22:19:11 -
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Fix passing --export-dynamic to the linker.
+
+Index: src/Makefile.am
+--- src/Makefile.am.orig
 src/Makefile.am
+@@ -24,5 +24,6 @@ AM_CPPFLAGS = @PACKAGE_CFLAGS@ \
+   -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+   -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
+ 
+-AM_CFLAGS = -export-dynamic -Wall
++AM_CFLAGS = -Wall
++AM_LDAGS = -rdynamic
+ 
Index: patches/patch-src_Makefile_in
===
RCS file: patches/patch-src_Makefile_in
diff -N patches/patch-src_Makefile_in
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-src_Makefile_in   21 Dec 2017 22:19:11 -
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+Fix passing --export-dynamic to the linker.
+
+Index: src/Makefile.in
+--- src/Makefile.in.orig
 src/Makefile.in
+@@ -194,7 +194,8 @@ AM_CPPFLAGS = @PACKAGE_CFLAGS@ \
+   -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+   -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
+ 
+-AM_CFLAGS = -export-dynamic -Wall
++AM_CFLAGS = -Wall
++AM_LDFLAGS = -rdynamic
+ all: all-am
+ 
+ .SUFFIXES:

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE



Re: on clang-archs: watch out for '-e xport-dynamic' warnings

2017-12-20 Thread Jeremie Courreges-Anglas
On Thu, Dec 21 2017, Matthias Kilian  wrote:
> Hi,
>
> I just got a bug report from Sebastian Neuper about editors/gummi
> misbehaving when built with clang. Details about the bug aren't
> important, but he well-spooted this one in the build log:
>
> cc: warning: argument unused during compilation: '-e xport-dynamic' 
> [-Wunused-command-line-argument]
>
> He also reported that using GCC did fix the problem (not only the
> warning).
>
> Looking at my build logs (only a few, because I run dpb -uR), I
> noticed some other ports producing this warning, and they invoke
> gcc with the flag -export-dynamic. Which is wrong.
>
> When using gcc(1), -rdynamic should be used to pass -export-dynamic
> to the linker (so says the man page).
>
> When using clang(1) -rdynamic can be used to pass -export-dynamic
> to eh linker (so says jca@ on icb after having a look at the clang
> sources).
>
> If any *real* bulk builders on clang-archs could grep for '-e
> xport-dynamic' after the next bulk build, that would be great.

Using logs from

  http://exopi.exo.bsdfrog.org/logs/old/amd64/2017-12-12T09:09:38+0100.tar.gz

here's the output of ''ag warning:.*xport-dynamic'':

paths/lang/squeak/vm.log:4328:cc: warning: argument unused during compilation: 
'-e xport-dynamic' [-Wunused-command-line-argument]
paths/lang/squeak/vm.log:4332:cc: warning: argument unused during compilation: 
'-e xport-dynamic' [-Wunused-command-line-argument]
paths/lang/sbcl.log:1693:/usr/bin/ld: warning: cannot find entry symbol 
xport-dynamic; defaulting to 00400f60
paths/x11/xfce4/xfce4-power-manager.log:644:cc: warning: argument unused during 
compilation: '-e xport-dynamic' [-Wunused-command-line-argument]
paths/x11/xfce4/xfce4-power-manager.log:647:cc: warning: argument unused during 
compilation: '-e xport-dynamic' [-Wunused-command-line-argument]
paths/x11/xfce4/xfce4-power-manager.log:650:cc: warning: argument unused during 
compilation: '-e xport-dynamic' [-Wunused-command-line-argument]
paths/x11/xfce4/xfce4-power-manager.log:657:cc: warning: argument unused during 
compilation: '-e xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:135:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:138:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:141:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:144:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:147:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:150:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:153:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:156:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:159:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:162:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:172:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:175:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:178:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/x11/klavaro.log:181:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/net/gnaughty.log:147:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/net/gnaughty.log:214:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/net/gnaughty.log:281:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/net/gnaughty.log:284:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/net/gnaughty.log:287:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/net/gnaughty.log:290:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/net/gnaughty.log:293:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]
paths/net/gnaughty.log:296:cc: warning: argument unused during compilation: '-e 
xport-dynamic' [-Wunused-command-line-argument]