Bug 248859

Summary: x11-wm/piewm: Fix link error: "ld: error: duplicate symbol: yylineno"
Product: Ports & Packages Reporter: david
Component: Individual Port(s)Assignee: Kyle Evans <kevans>
Status: Closed FIXED    
Severity: Affects Many People CC: dhw, emaste, kevans, ports-bugs
Priority: --- Keywords: needs-qa
Version: LatestFlags: koobs: merge-quarterly?
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 248756    
Attachments:
Description Flags
Patch to x11-wm/piewm/Makefile to add the "-fcommon" flag.
david: maintainer-approval+
Better fix for x11-wm/piewm david: maintainer-approval+

Description david 2020-08-23 20:37:24 UTC
Created attachment 217466 [details]
Patch to x11-wm/piewm/Makefile to add the "-fcommon" flag.

pkg-fallout@FreeBSD.org informs me that x11-wm/piewm is now failing to link under recent FreeEBSD head with the whine:

...
                                                                     
--- piewm ---
rm -f piewm
cc -o piewm       -L/usr/local/lib   gram.o lex.o deftwmrc.o add_window.o gc.o list.o twm.o             parse.o menus.o events.o resize.o util.o version.o iconmgr.o            cursor.o icons.o vdt.o move.o LocPixmap.o -lXmu -lXt -lSM -lICE -lXext -lX11 -lXt -lSM -lICE -lXext -lXext -lX11 -lm -ll -lXpm      -Wl,-rpath,/usr/local/lib
ld: error: duplicate symbol: yylineno
>>> defined at gram.c
>>>            gram.o:(yylineno)
>>> defined at lex.c
>>>            lex.o:(.data+0x0)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [piewm] Error code 1

make[1]: stopped in /wrkdirs/usr/ports/x11-wm/piewm/work/piewm-1.04
1 error


I confess that I don't know enough about actually using lex, yacc, and their work-alikes to "un-duplicate"  yylineno.  I can, however, patch the port's Makefile to include "CFLAGS+=-fcommon", so that's what I'm doing for now.

Note: I strongly suspect that x11-wm/tvtwm is similarly affected (and that if a "real fix" is put forth for it, that a similar fix will apply to x11-wm/piewm).
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-08-24 03:00:45 UTC
^Triage: 

- [tags] in issue Titles are deprecated

- Please set the maintainer-approval attachment flag (to +) on patches for ports you maintain to signify approval

Attachment -> Details -> maintainer-approval [+]
Comment 2 david 2020-08-24 03:14:48 UTC
Oh -- thanks.  It looks as if the patch (now that you've updated things) has the "maintainer approval" flag, so I don't need to be trying to set it (but for next time, I should do it correctly), yeah?
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2020-08-24 03:17:30 UTC
(In reply to david from comment #2)

Hi David,

I didn't set the maintainer-approval flag in the previous update,. so please feel free to set it (to +) on this and future attachments for ports you maintain
Comment 4 david 2020-08-24 03:20:56 UTC
Comment on attachment 217466 [details]
Patch to x11-wm/piewm/Makefile to add the "-fcommon" flag.

>Index: x11-wm/piewm/Makefile
>===================================================================
>--- x11-wm/piewm/Makefile	(revision 545815)
>+++ x11-wm/piewm/Makefile	(working copy)
>@@ -14,6 +14,6 @@
> DISABLE_SIZE=	yes
> USE_XORG=	xbitmaps xpm xmu
> 
>-CFLAGS+=	-Wno-return-type
>+CFLAGS+=	-Wno-return-type -fcommon
> 
> .include <bsd.port.mk>
Comment 5 david 2020-08-24 12:07:19 UTC
Created attachment 217487 [details]
Better fix for x11-wm/piewm

This patch is a result from having issued "svn rm x11-wm/piewm/files/patch-gram.y"
Comment 6 david 2020-08-24 12:11:02 UTC
The new patch is a result of advice from dim@; after verifying that I was able to reproduce the observed failure under head @r364650, I tested and observed that removing the offending file allows the port to build in that environment.
Comment 7 commit-hook freebsd_committer freebsd_triage 2020-08-27 14:33:33 UTC
A commit references this bug:

Author: kevans
Date: Thu Aug 27 14:33:29 UTC 2020
New revision: 546348
URL: https://svnweb.freebsd.org/changeset/ports/546348

Log:
  x11-wm/piewm: fix the build with LLVM 11

  This patch de-extern'd yylineno to actually cause the build failure that
  popped up with the new -fno-common default that debuted in LLVM 11 and GCC
  10. Simply remove the patch to fix the build.

  PR:		248859
  MFH:		2020Q3 (-fno-common build fix)

Changes:
  head/x11-wm/piewm/files/patch-gram.y
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-08-27 14:35:35 UTC
A commit references this bug:

Author: kevans
Date: Thu Aug 27 14:34:54 UTC 2020
New revision: 546349
URL: https://svnweb.freebsd.org/changeset/ports/546349

Log:
  MFH: r546348

  x11-wm/piewm: fix the build with LLVM 11

  This patch de-extern'd yylineno to actually cause the build failure that
  popped up with the new -fno-common default that debuted in LLVM 11 and GCC
  10. Simply remove the patch to fix the build.

  PR:		248859

  Approved by:	ports-secteam (implicit, -fno-common build fix)

Changes:
_U  branches/2020Q3/
  branches/2020Q3/x11-wm/piewm/files/patch-gram.y
Comment 9 Kyle Evans freebsd_committer freebsd_triage 2020-08-27 14:42:49 UTC
Committed, thanks! 

Note that you may still get another fallout e-mail or two if a new build had started prior to the commit, but I reviewed the patch and also confirmed that it was OK.

Apologies for the delay.