bugGNU Screen - Bugs: bug #45345, utmp.c requires utmp.h include...

 
 

bug #45345: utmp.c requires utmp.h include under musl

Submitted by:  None
Submitted on:  Wed 17 Jun 2015 09:20:37 PM UTC  
 
Category: Build/InstallSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedRelease: Cur Dev Sources
Fixed Release: 4.3.0Planned Release: None
Work Required: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 07 Jul 2015 06:20:04 PM UTC, comment #3:

screen 4.3.0 seems to compile ok.

Anonymous
Sun 28 Jun 2015 09:30:59 PM UTC, comment #2:

Which version did you use to test, can you retest with 4.3.0 tarball or screen-v4 branch?

os.h should already be included by screen.h

Amadeusz Sławiński <amade>
Project Administrator
Sat 20 Jun 2015 10:21:35 PM UTC, comment #1:

The relevant code (replacing getlogin()) is behind a BUGGYGETLOGIN. Is
this macro nowadays still relevant? acconfig.h says about this macro:

/*

  • If ttyslot() breaks getlogin() by returning indexes to utmp entries
  • of type DEAD_PROCESS, then our getlogin() replacement should be
  • selected by defining BUGGYGETLOGIN.

*/

In contrast, we have in configure.in:

oldlibs="$LIBS"
LIBS="$LIBS -lelf"
AC_CHECKING(SVR4)
AC_TRY_LINK([#include <utmpx.h>
],,
[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
,LIBS="$oldlibs")

So whether getlogin() will be replaced depends on whether libelf is installed...

Anonymous
Wed 17 Jun 2015 09:20:37 PM UTC, original submission:

In order to be able to compile screen in a musl libc toolchain we need to patch src/utmp.c to include "os.h" which takes care of properly including utmp.h

Without the fix the compilation fails like this:

<pre>mips_mips32_gcc-4.8-linaro_musl-1.1.10/usr/include -I/mnt/dl/slave/brcm63xx.smp/build/staging_dir/toolchain-mips_mips32_gcc-4.8-linaro_musl-1.1.10/include -DETCSCREENRC='"/etc/screenrc"' -DSCREENENCODINGS='"/usr/share/screen/utf8encodings"' -DHAVE_CONFIG_H -DGIT_REV=\""`git describe --always 2>/dev/null`"\" \
-Os -pipe -mno-branch-likely -mips32 -mtune=mips32 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro -D_GNU_SOURCE utmp.c
utmp.c: In function 'getlogin':
utmp.c:850:15: error: storage size of 'u' isn't known
struct utmp u;
^
utmp.c:860:38: error: invalid application of 'sizeof' to incomplete type 'struct utmp'
while (read(fd, (char *)&u, sizeof(struct utmp)) == sizeof(struct utmp))
^</pre>

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #34250:  os-include.patch added by None (171B - text/x-patch - Proposed patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by amade (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 08 Jul 2015 07:41:11 PM UTCamadeStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.3.0
    Wed 17 Jun 2015 09:20:37 PM UTCNoneAttached File-=>Added os-include.patch, #34250

    Back to the top


    Powered by Savane 3.1-cleanup1