Every time when i try to compile media-libs/libid3tag-0.15.1b-r4 it breaks with this error: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b -I. -Wall -pipe -march=bdver2 -mtune=bdver2 -O2 -fomit-frame-pointer -c /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/compat.c -fPIC -DPIC -o .libs/compat.o compat.gperf:116:1: error: conflicting types for 'id3_compat_lookup' In file included from compat.gperf:37:0: /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/compat.h:36:26: note: previous declaration of 'id3_compat_lookup' was here struct id3_compat const *id3_compat_lookup(register char const *, ^~~~~~~~~~~~~~~~~ make[2]: *** [Makefile:373: compat.lo] Fehler 1 make[2]: Verzeichnis „/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b-abi_x86_64.amd64“ wird verlassen make[1]: *** [Makefile:409: all-recursive] Fehler 1 make[1]: Verzeichnis „/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b-abi_x86_64.amd64“ wird verlassen make: *** [Makefile:241: all] Fehler 2 * ERROR: media-libs/libid3tag-0.15.1b-r4::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=media-libs/libid3tag-0.15.1b-r4::gentoo'`, * the complete build log and the output of `emerge -pqv '=media-libs/libid3tag-0.15.1b-r4::gentoo'`. * The complete build log is located at '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/temp/environment'. * Working directory: '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b-abi_x86_64.amd64' * S: '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b' >>> Failed to emerge media-libs/libid3tag-0.15.1b-r4, Log file: >>> '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/temp/build.log' * Messages for package media-libs/libid3tag-0.15.1b-r4: * ERROR: media-libs/libid3tag-0.15.1b-r4::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=media-libs/libid3tag-0.15.1b-r4::gentoo'`, * the complete build log and the output of `emerge -pqv '=media-libs/libid3tag-0.15.1b-r4::gentoo'`. * The complete build log is located at '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/temp/environment'. * Working directory: '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b-abi_x86_64.amd64' * S: '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b' With dev-util/gperf-3.0.4 everything works fine. Reproducible: Always Steps to Reproduce: 1.Install dev-utils/gperf-3.1 2.Try to compile media-libs/libid3tag-0.15.1b-r4
Created attachment 459320 [details] The full build.log
Created attachment 459322 [details] emerge --info output
Created attachment 459324 [details] The build environment file
same at a tinderbox image
Created attachment 459618 [details] emerge-info.txt emerge --info
Created attachment 459620 [details] config.log
Created attachment 459622 [details] emerge-history.txt
Created attachment 459624 [details] environment
Created attachment 459626 [details] etc.portage.tbz2
Created attachment 459628 [details] media-libs:libid3tag-0.15.1b-r4:20170111-143253.log
without 2 patches: libid3tag-0.15.1b-compat.patch & libid3tag-0.15.1b-unknown-encoding.patch, it is compiled
same problem here: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b -I. -Wall -pipe -march=core-avx-i -O2 -fomit-frame-pointer -c /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/compat.c -fPIC -DPIC -o .libs/compat.o compat.gperf:116:1: error: conflicting types for 'id3_compat_lookup' In file included from compat.gperf:37:0: /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/compat.h:36:26: note: previous declaration of 'id3_compat_lookup' was here struct id3_compat const *id3_compat_lookup(register char const *, ^ x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b -I. -Wall -pipe -march=core-avx-i -O2 -fomit-frame-pointer -c /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c -fPIC -DPIC -o .libs/frame.o x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b -I. -Wall -pipe -march=core-avx-i -O2 -fomit-frame-pointer -c /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/genre.c -fPIC -DPIC -o .libs/genre.o x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b -I. -Wall -pipe -march=core-avx-i -O2 -fomit-frame-pointer -c /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/crc.c -fPIC -DPIC -o .libs/crc.o make[2]: *** [Makefile:373: compat.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b -I. -Wall -pipe -march=core-avx-i -O2 -fomit-frame-pointer -c /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/tag.c -fPIC -DPIC -o .libs/tag.o /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c: In function 'id3_frame_parse': /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:283:34: warning: pointer targets in passing argument 1 of 'id3_compat_lookup' differ in signedness [-Wpointer-sign] compat = id3_compat_lookup(id, 3); ^ In file included from /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:38:0: /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/compat.h:36:26: note: expected 'const char *' but argument is of type 'const id3_byte_t * {aka const unsigned char *}' struct id3_compat const *id3_compat_lookup(register char const *, ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:299:34: warning: pointer targets in passing argument 1 of 'id3_compat_lookup' differ in signedness [-Wpointer-sign] compat = id3_compat_lookup(id, 4); ^ In file included from /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:38:0: /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/compat.h:36:26: note: expected 'const char *' but argument is of type 'const id3_byte_t * {aka const unsigned char *}' struct id3_compat const *id3_compat_lookup(register char const *, ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:311:22: warning: pointer targets in passing argument 1 of 'unparseable' differ in signedness [-Wpointer-sign] frame = unparseable(id, ptr, end - *ptr, 0, 0, 0, 0); ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:203:19: note: expected 'const char *' but argument is of type 'const id3_byte_t * {aka const unsigned char *}' struct id3_frame *unparseable(char const *id, id3_byte_t const **ptr, ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:351:10: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] id = compat->equiv; ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:358:10: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] id = xid; ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:379:27: warning: pointer targets in passing argument 1 of 'unparseable' differ in signedness [-Wpointer-sign] frame = unparseable(id, ptr, end - *ptr, flags, 0, 0, 0); ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:203:19: note: expected 'const char *' but argument is of type 'const id3_byte_t * {aka const unsigned char *}' struct id3_frame *unparseable(char const *id, id3_byte_t const **ptr, ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:426:25: warning: pointer targets in passing argument 1 of 'unparseable' differ in signedness [-Wpointer-sign] frame = unparseable(id, &data, end - data, flags, ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:203:19: note: expected 'const char *' but argument is of type 'const id3_byte_t * {aka const unsigned char *}' struct id3_frame *unparseable(char const *id, id3_byte_t const **ptr, ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:448:22: warning: pointer targets in passing argument 1 of 'obsolete' differ in signedness [-Wpointer-sign] frame = obsolete(id, data, end - data); ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:179:19: note: expected 'const char *' but argument is of type 'const id3_byte_t * {aka const unsigned char *}' struct id3_frame *obsolete(char const *id, id3_byte_t const *data, ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:454:25: warning: pointer targets in passing argument 1 of 'id3_frame_new' differ in signedness [-Wpointer-sign] frame = id3_frame_new(id); ^ /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/frame.c:67:19: note: expected 'const char *' but argument is of type 'const id3_byte_t * {aka const unsigned char *}' struct id3_frame *id3_frame_new(char const *id) ^ x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b -I. -Wall -pipe -march=core-avx-i -O2 -fomit-frame-pointer -c /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/file.c -fPIC -DPIC -o .libs/file.o x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b -I. -Wall -pipe -march=core-avx-i -O2 -fomit-frame-pointer -c /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/util.c -fPIC -DPIC -o .libs/util.o /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/tag.c: In function 'v1_attachstr': /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/tag.c:354:23: warning: pointer targets in passing argument 1 of 'id3_latin1_decode' differ in signedness [-Wpointer-sign] id3_latin1_decode(text, ucs4); ^ In file included from /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/tag.c:41:0: /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/latin1.h:36:6: note: expected 'const id3_latin1_t * {aka const unsigned char *}' but argument is of type 'char *' void id3_latin1_decode(id3_latin1_t const *, id3_ucs4_t *); ^ make[2]: Leaving directory '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b-abi_x86_64.amd64' make[1]: *** [Makefile:409: all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b-abi_x86_64.amd64' make: *** [Makefile:241: all] Error 2 * ERROR: media-libs/libid3tag-0.15.1b-r4::gentoo failed (compile phase): * emake failed ########################### Portage 2.3.3 (python 3.5.2-final-0, default/linux/amd64/13.0/desktop/plasma/systemd, gcc-5.4.0, glibc-2.24-r1, 4.9.10-gentoo x86_64) ================================================================= System uname: Linux-4.9.10-gentoo-x86_64-Intel-R-_Core-TM-_i7-3740QM_CPU_@_2.70GHz-with-gentoo-2.3 KiB Mem: 24626192 total, 22071652 free KiB Swap: 26488828 total, 26488828 free Timestamp of repository gentoo: Fri, 17 Feb 2017 23:30:01 +0000 Timestamp of repository poly-c: Fri, 17 Feb 2017 20:58:39 +0000 sh bash 4.4_p12 ld GNU ld (Gentoo 2.27 p1.0) 2.27 app-shells/bash: 4.4_p12::gentoo dev-java/java-config: 2.2.0-r3::gentoo dev-lang/perl: 5.24.1::gentoo dev-lang/python: 2.7.12::gentoo, 3.4.5::gentoo, 3.5.2::gentoo dev-util/cmake: 3.7.2::gentoo dev-util/pkgconfig: 0.29.1::gentoo sys-apps/baselayout: 2.3::gentoo sys-apps/openrc: 0.23.2::gentoo sys-apps/sandbox: 2.10-r3::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r2::gentoo sys-devel/automake: 1.13.4-r1::gentoo, 1.15-r2::gentoo sys-devel/binutils: 2.27::gentoo sys-devel/gcc: 5.4.0-r3::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r2::gentoo sys-devel/make: 4.2.1::gentoo sys-kernel/linux-headers: 4.9::gentoo (virtual/os-headers) sys-libs/glibc: 2.24-r1::gentoo Repositories:
Definitely not here, Helmut
I can confirm it doesn't compile on my two systems, with the same error as in comment #12. Both are using gperf 3.1 (and gcc 5.4/5.3). It *does* compile on my laptop with gperf 3.0.4 (and gcc 4.9), which supports the claim in the bug's title. I can also confirm comment #11, it does build after removing these two patches.
> I can confirm it doesn't compile on my two systems, with the same error as > in comment #12. Both are using gperf 3.1 (and gcc 5.4/5.3). It *does* > compile on my laptop with gperf 3.0.4 (and gcc 4.9), which supports the > claim in the bug's title. > > I can also confirm comment #11, it does build after removing these two > patches. Likewise result, here.
Created attachment 467096 [details, diff] Fix mismatching declarations. FWIW, the compiler is perfectly right in rejecting this code. Declaration and definition diverge in function parameters. The reason why removing the other two mentioned patches "fixed" this problem for the other users is likely that compat.gperf is regenerated if touched - not patching this file leaves it in its default state, which matches the function declaration in the header file. Maybe. Anyway, using size_t here is cleaner in any case.
Err, one other thing: please test the attached patch with gperf < 3.1. I haven't done this. If it breaks, that means that ``id3_compat_lookup()'' is defined with a parameter taking ``unsigned int'' instead of ``size_t'' with older gperf versions, in which case we'll must dig deeper and find out how code in compat.gperf is generated in the first place.
Patch from comment 16 works when using gperf-3.1 but not when using gperf-3.0.4: compat.gperf: In function 'id3_compat_lookup': compat.gperf:126:28: error: argument 'len' doesn't match prototype In file included from compat.gperf:37:0: /var/tmp/portage/media-libs/libid3tag-0.15.1b-r4/work/libid3tag-0.15.1b/compat.h:36:26: error: prototype declaration struct id3_compat const *id3_compat_lookup(register char const *, ^~~~~~~~~~~~~~~~~ make[2]: *** [Makefile:373: compat.lo] Error 1
FWIW, I'm seeing the problem too. gperf-3.1 installed and trying to rebuild libid3tag due to recent tree changes apparently triggering --changed-deps rebuilds nearly tree-wide. (In reply to Mihai Moldovan from comment #17) > If [the patch with gperf-3.0.4] breaks, that means that > ``id3_compat_lookup()'' is defined with a parameter taking > ``unsigned int'' instead of ``size_t'' with older gperf > versions, in which case we'll must dig deeper and find out > how code in compat.gperf is generated in the first place. While I haven't tested with old gperf, I /do/ see the following, which looks likely to be pertinent, in the gperf-3.1 NEWS file under "New in 3.1:" "* The 'len' parameter of the hash function and of the lookup function is now of type 'size_t' instead of 'unsigned int'. This makes it safe to call these functions with strings of length > 4 GB, on 64-bit machines." Don't ask me how to translate that into an appropriate patch, ENODEV (dev meaning developer here, I'm not a dev, not device). But the type change match sure looks like a smoking gun to me. I think we found the cause, now to find an appropriate fix.
Yes, I already expected that. Fortunately, the file itself mentions how it was generated. "gperf -tCcTonD -K id -N id3_compat_lookup -s -3 -k '*' compat.gperf" should be all that's needed, so if we just run that manually it should update the bundled copy with what is correct for the running gperf version. Might also need to do this with the other gperf files. I'll check this out later.
Created attachment 468948 [details, diff] Fix mismatching declarations with gperf 3.1+. Okay, I have a clearer understanding of what's happening. The user that reported that leaving out some patches was right - these were the only ones touching ``compat.gperf''. When this file is modified, it's automatically re-generated. With gperf-3.1, the implementation (generated through ``compat.gperf'' as ``compat.c'') gets out of sync with the declaration in ``compat.h''. The real problem is that ``compat.h'' is not generated, but written manually and hence static in nature. The solution, however, is easy, since we can just patch ``compat.h'' if gperf 3.1 or higher is installed. Older versions are fine without that patch, as declaration and definition will match automatically.
Another way around this problem is presented in https://bugs.gentoo.org/show_bug.cgi?id=605022 - essentially, floppym added gperf version detection support to the build system and is using a macro to switch between types based upon the detected version. It makes patching more universal, but is also more invasive. His fix can be upstreamed, though, while a static patch can't. I guess I'll try refactoring this when I have spare time to kill.
patched version (attachment #468948 [details, diff]) is working fine for me, thanks!
*** Bug 621388 has been marked as a duplicate of this bug. ***
commit 96b4b793f5825acbd0c2406ce306b29759afb95c (HEAD -> master, origin/master, origin/HEAD) Author: Alexis Ballier <aballier@gentoo.org> Date: Fri Jun 16 12:37:04 2017 +0200 media-libs/libid3tag: Fix build with gperf 3.1. https://bugs.gentoo.org/show_bug.cgi?id=605158 By Mihai Moldovan. thanks