Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 541694 - app-admin/longrun-0.9-r4 compile error: unknown type name ‘loff_t’ on hardened/musl
Summary: app-admin/longrun-0.9-r4 compile error: unknown type name ‘loff_t’ on hardene...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo musl team
URL:
Whiteboard:
Keywords: InOverlay, PMASKED
Depends on: 905186
Blocks: musl-porting
  Show dependency tree
 
Reported: 2015-02-28 18:46 UTC by Cato Auestad
Modified: 2023-11-08 12:44 UTC (History)
2 users (show)

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


Attachments
longrun-0.9-r4 ebuild patch (longrun-0.9-musl-ebuild.patch,712 bytes, patch)
2015-02-28 18:46 UTC, Cato Auestad
Details | Diff
emerge --info (longrun-emerge-info.log,4.11 KB, text/plain)
2015-02-28 18:46 UTC, Cato Auestad
Details
longrun build log (longrun-build-log.log,2.93 KB, text/plain)
2015-02-28 18:47 UTC, Cato Auestad
Details

Note You need to log in before you can comment on or make changes to this bug.
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 1 Cato Auestad 2015-02-28 18:46:42 UTC
Created attachment 397688 [details]
emerge --info
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 gentoo-dev 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 gentoo-dev 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 gentoo-dev 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).
Comment 9 Larry the Git Cow gentoo-dev 2023-10-08 11:12:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1acf70f43bb0b453aa9677f38fda1b58aa1e7b5d

commit 1acf70f43bb0b453aa9677f38fda1b58aa1e7b5d
Author:     David Seifert <soap@gentoo.org>
AuthorDate: 2023-10-08 11:12:18 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2023-10-08 11:12:18 +0000

    package.mask: Last rite app-admin/longrun
    
    Bug: https://bugs.gentoo.org/541694
    Bug: https://bugs.gentoo.org/905186
    Signed-off-by: David Seifert <soap@gentoo.org>

 profiles/package.mask | 6 ++++++
 1 file changed, 6 insertions(+)
Comment 10 Larry the Git Cow gentoo-dev 2023-11-08 12:44:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36a8157fffafcf645cd627b494df51b5586321f3

commit 36a8157fffafcf645cd627b494df51b5586321f3
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2023-11-08 12:41:33 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2023-11-08 12:41:46 +0000

    app-admin/longrun: treeclean
    
    Closes: https://bugs.gentoo.org/541694
    Closes: https://bugs.gentoo.org/905186
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 app-admin/longrun/Manifest                        |  3 -
 app-admin/longrun/files/0.9-makefile_cflags.patch | 13 -----
 app-admin/longrun/files/0.9-replace-loff_t.patch  | 35 ------------
 app-admin/longrun/longrun-0.9-r4.ebuild           | 70 -----------------------
 app-admin/longrun/longrun-0.9-r5.ebuild           | 66 ---------------------
 app-admin/longrun/metadata.xml                    | 10 ----
 profiles/package.mask                             |  6 --
 7 files changed, 203 deletions(-)