|Summary:||app-admin/longrun-0.9-r4 compile error: unknown type name ‘loff_t’ on hardened/musl|
|Product:||Gentoo Linux||Reporter:||Cato Auestad <cato>|
|Component:||Hardened||Assignee:||Gentoo musl team <musl>|
|Package list:||Runtime testing required:||---|
|Bug Depends on:|
longrun-0.9-r4 ebuild patch
longrun build log
Description Cato Auestad 2015-02-28 18:46:08 UTC
Created attachment 397686 [details, diff] longrun-0.9-r4 ebuild patch app-admin/longrun fails to compile with musl on hardened because it uses loff_t in longrun.c. Can be fixed by adding "append-flags -D_GNU_SOURCE" in ebuild. Attached diff for your convenience. Summary Build log: ------------------------------------------------ make CC=x86_64-gentoo-linux-musl-gcc x86_64-gentoo-linux-musl-gcc -O2 -pipe -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed -DLOCALEDIR=\"/usr/share/locale\" -W -Wall -o longrun longrun.c longrun.c:184:15: error: unknown type name ‘loff_t’ void read_msr(loff_t address, int *lower, int *upper) ^ longrun.c:196:16: error: unknown type name ‘loff_t’ void write_msr(loff_t address, int lower, int upper) ^ longrun.c:209:17: error: unknown type name ‘loff_t’ void read_cpuid(loff_t address, int *eax, int *ebx, int *ecx, int *edx) ^ longrun.c: In function ‘check_cpu’: longrun.c:228:2: warning: implicit declaration of function ‘read_cpuid’ [-Wimplicit-function-declaration] read_cpuid(CPUID_TMx86_VENDOR_ID, &eax, &ebx, &ecx, &edx); ^ longrun.c: In function ‘print_lrti_info’: longrun.c:249:2: warning: implicit declaration of function ‘read_msr’ [-Wimplicit-function-declaration] read_msr(MSR_TMx86_LRTI_READOUT, &junk, &max); ^ longrun.c:251:2: warning: implicit declaration of function ‘write_msr’ [-Wimplicit-function-declaration] write_msr(MSR_TMx86_LRTI_READOUT, 0, max); ^ Makefile:6: recipe for target 'longrun' failed make: *** [longrun] Error 1 emake failed ERROR: app-admin/longrun-0.9-r4::gentoo failed (compile phase): emake failed Call stack: ebuild.sh, line 93: Called src_compile environment, line 2582: Called die The specific snippet of code: emake CC="$(tc-getCC)" || die "emake failed"
Comment 2 Cato Auestad 2015-02-28 18:47:11 UTC
Created attachment 397690 [details] longrun build log
Comment 3 Felix Janda 2015-03-01 07:59:28 UTC
The loff_t can be safely replaced by off_t. That's the type used by pread() and pwrite(). The relevant code is introduced by the patch from Debian, which seems to be effectively the upstream for this package. It would be good to try to get Debian to fix the patch.
Comment 4 Cato Auestad 2015-03-01 13:06:23 UTC
Alright. I'll contact the Debian maintainer and get his input.
Comment 5 Anthony Basile 2015-03-02 13:01:09 UTC
(In reply to Cato Auestad from comment #4) > Alright. I'll contact the Debian maintainer and get his input. This package is maintainer-needed, so I can go ahead and fix upt that patch. It sounds like its an artifact of the debian patch and not in the unpached code. Correct?
Comment 6 Cato Auestad 2015-03-02 18:15:08 UTC
(In reply to Anthony Basile from comment #5) > (In reply to Cato Auestad from comment #4) > > Alright. I'll contact the Debian maintainer and get his input. > > This package is maintainer-needed, so I can go ahead and fix upt that patch. > It sounds like its an artifact of the debian patch and not in the unpached > code. Correct? Correct. read_msr, write_msr and read_cpuid originally takes a "long address" but the Debian patch replaces it with "loff_t address". I have submitted the patch to the Debian maintainer but haven't got a response yet.
Comment 7 Anthony Basile 2015-03-07 19:47:48 UTC
I add a patch to change loff_t to off_t. The only consumer of off_t address in those functions is pread/pwrite() which take off_t as Felix said. I'm going to close this for now, but redirect the debian maintainer here.
Comment 8 Anthony Basile 2015-03-08 01:41:26 UTC
Actually I'm reopening so the workflow can indicate that its in the overlay but still has to be pushed upstream (in this case to the debian maintainer).