Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 717032

Summary: net-p2p/mktorrent-1.1_p20180912 : prefix.c: error: _WORDSIZE undeclared (first use in this function)
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Gentoo musl team <musl>
Status: RESOLVED FIXED    
Severity: normal CC: holgersson, opal, proxy-maint, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 713786    
Attachments: emerge-info.txt
emerge-history.txt
environment
etc.portage.tbz2
net-p2p:mktorrent-1.1_p20180912:20200411-073220.log
temp.tbz2
mktorrent-1.1_p20210130.ebuild
updated ebuild (fixed version)

Description Toralf Förster gentoo-dev 2020-04-11 09:27:42 UTC
x86_64-gentoo-linux-musl-gcc -O2 -pipe -march=native -DUSE_PTHREADS -DUSE_OPENSSL -DUSE_LONG_OPTIONS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DDEBUG -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 prefix.c -o prefix
prefix.c: In function main:
prefix.c:62:40: error: __WORDSIZE undeclared (first use in this function)
   62 |  fprintf(stderr, __WORDSIZE is %d\n, __WORDSIZE);
      |                                        ^~~~~~~~~~
prefix.c:62:40: note: each undeclared identifier is reported only once for each function it appears in

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

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0_musl_hardened-20200328-201618

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

  Please see the tracker bug for details.

gcc-config -l:
 [1] x86_64-gentoo-linux-musl-9.3.0 *
clang version 10.0.0 
Target: x86_64-gentoo-linux-musl
Thread model: posix
InstalledDir: /usr/lib/llvm/10/bin
/usr/lib/llvm/10
10.0.0
Available Python interpreters, in order of preference:
  [1]   python3.8
  [2]   python3.7
  [3]   python3.6
  [4]   python2.7 (fallback)
Available Ruby profiles:
  [1]   ruby24 (with Rubygems)
  [2]   ruby25 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.42.0
  [2]   rust-1.42.0 *
Available Java Virtual Machines:
  (none found)


timestamp of HEAD at this tinderbox image:
/var/db/repos/gentoo	Sat Apr 11 06:39:22 UTC 2020
/var/db/repos/musl	Wed Apr  8 18:15:58 UTC 2020

emerge -qpvO net-p2p/mktorrent
[ebuild  N    ] net-p2p/mktorrent-1.1_p20180912  USE="ssl -debug -libressl -threads"
Comment 1 Toralf Förster gentoo-dev 2020-04-11 09:27:44 UTC
Created attachment 632128 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2020-04-11 09:27:47 UTC
Created attachment 632130 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2020-04-11 09:27:50 UTC
Created attachment 632132 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2020-04-11 09:27:53 UTC
Created attachment 632134 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2020-04-11 09:27:55 UTC
Created attachment 632136 [details]
net-p2p:mktorrent-1.1_p20180912:20200411-073220.log
Comment 6 Toralf Förster gentoo-dev 2020-04-11 09:27:58 UTC
Created attachment 632138 [details]
temp.tbz2
Comment 7 opal hart 2021-06-09 03:21:15 UTC
It works to change SRC_URI="https://github.com/Rudde/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" and change version simply to 1.1. This is what Alpine's community/mktorrent package does.

Also, I'm not sure whether toolchain-funcs or the 'tc-export CC' line is necessary; it builds without, but I don't have an exotic compiler setup.
Comment 8 Nils Freydank 2021-06-09 13:12:25 UTC
Created attachment 714906 [details]
mktorrent-1.1_p20210130.ebuild

updated ebuild
Comment 9 Nils Freydank 2021-06-09 13:18:31 UTC
(In reply to opal hart from comment #7)
> It works to change
> SRC_URI="https://github.com/Rudde/${PN}/archive/v${PV}.tar.gz ->
> ${P}.tar.gz" and change version simply to 1.1. This is what Alpine's
> community/mktorrent package does.

Hi, thanks for the information. We can't fall back to 1.1 as this is the old (ancient) release from 2017 which had (other) bugs on gentoo. See https://bugs.gentoo.org/650340 and https://github.com/pobrn/mktorrent/issues/22 for details.

BTW, upstream shifted to a new user on github.com, but the code looks the same.

I assume you have a musl setup. Could you please test the bumped ebuild I uploaded?

> Also, I'm not sure whether toolchain-funcs or the 'tc-export CC' line is
> necessary; it builds without, but I don't have an exotic compiler setup.

Without toolchain-funcs the Makefile calls 'cc' instead of the full compiler name, e.g. 'x86_64-pc-linux-gnu-gcc'. While this seems to work fine on my ~amd64/x86 setup it might break cross compiling. To confirm, I asked about it on IRC in #gentoo-dev-help (thanks to ionen and CyberTailor!).

I'm not entirely sure about it, but as the explicit CC exporting doesn't break anything on ~amd64 I prefer to keep it.
Comment 10 opal hart 2021-06-10 04:27:05 UTC
> We can't fall back to 1.1

Understood. Is that reproducible with -march=native on all x86/x86_64 platforms and any generated .torrent file? If so, I'll test it both on 1.1 and with your ebuild and see if there is an improvement.

> upstream shifted to a new user on github.com, but the code looks the same.

You're right, I didn't pay attention to the redirect.

> I assume you have a musl setup.

Yep, I'll test soon.

> Without toolchain-funcs the Makefile calls 'cc'

Sounds like this should be filed upstream to prefer ${CC} in the makefile.
Comment 11 Nils Freydank 2021-06-10 08:26:11 UTC
Created attachment 715053 [details]
updated ebuild (fixed version)

Fix ebuild, previous version had a copy-paste-failure as pointed out by Sam.
Comment 12 Larry the Git Cow gentoo-dev 2021-07-08 09:49:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c56f061b5d7eaf320fb28a6004ea70aea017586

commit 3c56f061b5d7eaf320fb28a6004ea70aea017586
Author:     Nils Freydank <holgersson@posteo.de>
AuthorDate: 2021-07-08 09:48:31 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2021-07-08 09:49:09 +0000

    net-p2p/mktorrent: bump snapshot versionm, respect CC
    
    Bug: https://bugs.gentoo.org/717032
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 net-p2p/mktorrent/Manifest                       |  1 +
 net-p2p/mktorrent/mktorrent-1.1_p20210130.ebuild | 45 ++++++++++++++++++++++++
 2 files changed, 46 insertions(+)