Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 732010 - app-text/discount-2.2.6 - ld: pandoc_headers.o: in function `main': pandoc_headers.c:(.text.startup+0x38): undefined reference to `hoptset'
Summary: app-text/discount-2.2.6 - ld: pandoc_headers.o: in function `main': pandoc_he...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Ben Kohler
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-10 06:59 UTC by Althorion
Modified: 2020-08-28 17:06 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,9.58 KB, text/plain)
2020-07-10 19:18 UTC, Althorion
Details
emerge --info (emerge-info.txt,17.89 KB, text/plain)
2020-07-10 19:19 UTC, Althorion
Details
app-text:discount-2.2.7:20200828-124337.log (app-text:discount-2.2.7:20200828-124337.log,9.55 KB, text/x-log)
2020-08-28 12:46 UTC, Andreas Sturmlechner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Althorion 2020-07-10 06:59:15 UTC
app-text/discount-2.2.6 fails to build with the following error:

main.c: In function ‘main’:
main.c:311:29: warning: passing argument 2 of ‘mkd_e_code_format’ from incompatible pointer type [-Wincompatible-pointer-types]
  311 |      mkd_e_code_format(doc, external_codefmt);
      |                             ^~~~~~~~~~~~~~~~
      |                             |
      |                             char * (*)(char *, int,  char *)
In file included from main.c:12:
./mkdio.h:71:31: note: expected ‘mkd_callback_t’ {aka ‘char * (*)(const char *, const int,  void *)’} but argument is of type ‘char * (*)(char *, int,  char *)’
   71 | void mkd_e_code_format(void*, mkd_callback_t);
      |                               ^~~~~~~~~~~~~~
x86_64-pc-linux-gnu-gcc -Wno-return-type -Wno-implicit-int -L. -Wl,-O1 -Wl,--as-needed -o echo echo.o
x86_64-pc-linux-gnu-gcc -Wno-return-type -Wno-implicit-int -L. -Wl,-O1 -Wl,--as-needed -o cols cols.o
x86_64-pc-linux-gnu-gcc -Wno-return-type -Wno-implicit-int -L. -Wl,-O1 -Wl,--as-needed -o pandoc_headers pandoc_headers.o pgm_options.o gethopt.o notspecial.o -lmarkdown 
/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: pandoc_headers.o: in function `main':
pandoc_headers.c:(.text.startup+0x38): undefined reference to `hoptset'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: pandoc_headers.c:(.text.startup+0x5c): undefined reference to `gethopt'
collect2: error: ld returned 1 exit status
make: *** [Makefile:143: pandoc_headers] Error 1

emerge --info '=app-text/discount-2.2.6::gentoo' → https://pastebin.com/5kmbffYB
emerge -pqv '=app-text/discount-2.2.6::gentoo':
[ebuild  N    ] app-text/discount-2.2.6  USE="-minimal -test" 
/var/tmp/portage/app-text/discount-2.2.6/temp/build.log → https://pastebin.com/SQd48msa

Reproducible: Always

Steps to Reproduce:
1. emerge '=app-text/discount-2.2.6'
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2020-07-10 12:06:14 UTC
(In reply to Althorion from comment #0)
> emerge --info '=app-text/discount-2.2.6::gentoo' →
> https://pastebin.com/5kmbffYB
> /var/tmp/portage/app-text/discount-2.2.6/temp/build.log →
> https://pastebin.com/SQd48msa

Attach both of those, please.
Comment 2 Althorion 2020-07-10 19:18:53 UTC
Created attachment 648830 [details]
build.log
Comment 3 Althorion 2020-07-10 19:19:27 UTC
Created attachment 648832 [details]
emerge --info
Comment 4 Ben Kohler gentoo-dev 2020-07-29 19:40:43 UTC
Does the build succeed with MAKEOPTS="-j1"? This looks really similar to bug 728930 which I applied a patch for, but maybe that upstream fix was incomplete
Comment 5 Ben Kohler gentoo-dev 2020-08-18 17:51:21 UTC
Can you please test with -j1? I cannot reproduce this, I may be forced to close this bug report w/o a fix
Comment 6 Andreas Sturmlechner gentoo-dev 2020-08-28 12:46:01 UTC
Created attachment 657302 [details]
app-text:discount-2.2.7:20200828-124337.log

Similar error here with -j24, no problem with -j1:

/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: pandoc_headers.o: in function `main':
pandoc_headers.c:(.text.startup+0x38): undefined reference to `hoptset'
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: pandoc_headers.c:(.text.startup+0x54): undefined reference to `gethopt'
collect2: error: ld returned 1 exit status
x86_64-pc-linux-gnu-gcc -Wno-return-type -Wno-implicit-int -L. -Wl,-O1 -Wl,--as-needed -o mkd2html mkd2html.o pgm_options.o gethopt.o notspecial.o -lmarkdown 
make: *** [Makefile:143: pandoc_headers] Error 1
make: *** Waiting for unfinished jobs....
Comment 7 Ben Kohler gentoo-dev 2020-08-28 17:05:01 UTC
Thanks, I was finally able to reproduce with with -j24 (about 1 in 3 attempts).  Looks like the last fix wasn't complete, there is another missing dep in Makefile.in.  Patch incoming.
Comment 8 Larry the Git Cow gentoo-dev 2020-08-28 17:06:48 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=023c0d68cbc40ee38d313166a89ccff6ad618c57

commit 023c0d68cbc40ee38d313166a89ccff6ad618c57
Author:     Ben Kohler <bkohler@gentoo.org>
AuthorDate: 2020-08-28 17:06:17 +0000
Commit:     Ben Kohler <bkohler@gentoo.org>
CommitDate: 2020-08-28 17:06:39 +0000

    app-text/discount: another parallel build fix
    
    Closes: https://bugs.gentoo.org/732010
    Package-Manager: Portage-3.0.4, Repoman-3.0.1
    Signed-off-by: Ben Kohler <bkohler@gentoo.org>

 app-text/discount/files/gethopt-undefined.patch | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)