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

Bug 168281

Summary: app-misc/screen-4.0.3 with sys-libs/uclibc-0.9.28.1 - In file included from screen.h:42, from screen.c:82: sched.h:26: error: redefinition of 'struct event'
Product: Gentoo Linux Reporter: Clemmitt M. Sigler <cmsigler>
Component: Current packagesAssignee: Sven Wegener <swegener>
Status: RESOLVED FIXED    
Severity: normal CC: cristi.magherusan, danny, gentoobugs, napalmllama, pacho, shell-tools, tl, vapier
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
patch to fix screen
fixed ebuild
sorry I attached the wrong patch before
Just fix file paths...
Wrapping all local headers
sched.h patch saved to files/screen-4.0.3-sched.patch

Description Clemmitt M. Sigler 2007-02-25 02:22:52 UTC
Emerging app-misc/screen-4.0.3 fails in a uclibc-based embedded system (TinyGentoo build).  System comes from stage3-x86-uclibc-2006.1 (http://gentoo.osuosl.org/experimental/x86/embedded/stages/stage3-x86-uclibc-2006.1.tar.bz2), with installed uclibc version sys-libs/uclibc-0.9.28.1.  gcc version is sys-devel/gcc-4.1.1-r3.

Build error is weird -->
-------------------------------------------
In file included from screen.h:42,
                 from screen.c:82:
sched.h:26: error: redefinition of 'struct event'
make: *** [screen.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from screen.h:42,
                 from ansi.c:32:
sched.h:26: error: redefinition of 'struct event'
make: *** [ansi.o] Error 1

!!! ERROR: app-misc/screen-4.0.3 failed.
Call stack:
  ebuild.sh, line 1614:   Called dyn_compile
  ebuild.sh, line 971:   Called qa_call 'src_compile'
  environment, line 3846:   Called src_compile
  screen-4.0.3.ebuild, line 99:   Called die
-------------------------------------------
Note that it doesn't say where the previous definition of 'struct event' is.  Is this a toolchain/cross-compiling problem (I'm guessing)?

This error is repeatable.  Downgrading to sys-libs/0.9.28-r2 corrects the problem with no other changes to system config.

# emerge --info
Portage 2.1.2-r9 (uclibc/x86, gcc-4.1.1, uclibc-0.9.28.1-r0, 2.6.19-gentoo-r5 i686)
=================================================================
System uname: 2.6.19-gentoo-r5 i686 Pentium III (Coppermine)
Gentoo Base System release 1.12.9
Timestamp of tree: Sat, 24 Feb 2007 19:20:01 +0000
ccache version 2.4 [enabled]
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.61
sys-devel/automake:  1.6.3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i386-gentoo-linux-uclibc"
CFLAGS="-march=pentium3 -Os -pipe"
CHOST="i386-gentoo-linux-uclibc"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=pentium3 -Os -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg ccache distlocks metadata-transfer nodoc noinfo noman parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://gentoo.mirrors.pair.com/ http://gentoo.mirrors.tds.net/gentoo http://gentoo.osuosl.org/ http://gentoo.itdnet.net/gentoo http://gentoo.chem.wisc.edu/gentoo/"
LDFLAGS="-Wl,-z,relro"
MAKEOPTS="-j2"
PKGDIR="/packages/uclibc"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="bitmap-fonts cli cracklib dri midi minimal ncurses pcre readline reflection session spl truetype-fonts type1-fonts uclibc x86 xorg zlib" ALSA_CARDS="ens1370" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="uclibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="vesa vga fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS

H all this H.

Clemmitt Sigler


Reproducible: Always

Steps to Reproduce:
1. Install from stage3 uclibc build system, stage3-x86-uclibc-2006.1.tar.bz2
2. Upgrade to sys-libs/uclibc-0.9.28.1 (with sys-devel/gcc-4.1.1-r3)
3. emerge -av screen
Comment 1 Michael Lange 2007-03-17 01:07:41 UTC
same here with uClibc-0.9.28.1 - not tested with sys-libs/0.9.28-r2

Portage 2.1.2.2 (uclibc/x86, gcc-4.1.1, uclibc-0.9.28.1-r0, 2.6.18-gentoo-r6 i686)
=================================================================
System uname: 2.6.18-gentoo-r6 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
Gentoo Base System release 1.12.9
Timestamp of tree: Fri, 16 Mar 2007 19:50:01 +0000
ccache version 2.4 [enabled]
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.61
sys-devel/automake:  1.6.3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i386-gentoo-linux-uclibc"
CFLAGS="-march=i686 -Os -pipe"
CHOST="i386-gentoo-linux-uclibc"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=i686 -Os -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg ccache distlocks metadata-transfer nodoc noinfo noman sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LDFLAGS="-Wl,-z,relro"
MAKEOPTS="-j2"
PKGDIR="/packages/uclibc"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/portage/mesa-cvs"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa bitmap-fonts cli cracklib dri fbcon jpeg midi minimal mmx mp3 ncurses pcre png readline reflection sdl session spl sse truetype-fonts type1-fonts uclibc x86 xine xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="uclibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="vga i810"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 2 Michael Lange 2007-03-17 01:11:33 UTC
Created attachment 113534 [details]
build.log
Comment 3 Jens Pranaitis 2007-03-19 19:38:50 UTC
A friend of mine, just fixed the bug, I've attached the patch and the fixed ebuild.
Comment 4 Jens Pranaitis 2007-03-19 19:39:50 UTC
Created attachment 113797 [details, diff]
patch to fix screen
Comment 5 Jens Pranaitis 2007-03-19 19:41:16 UTC
Created attachment 113798 [details]
fixed ebuild
Comment 6 Jens Pranaitis 2007-03-19 19:44:19 UTC
Created attachment 113800 [details, diff]
sorry I attached the wrong patch before

I attached the wrong patch before, this one works
Comment 7 SpanKY gentoo-dev 2007-03-25 15:47:03 UTC
not a bug in uClibc ... slightly different header behavior from uClibc triggers this bug in screen itself, but with one tweak to glibc, i can make it bomb there

the basic problem is that screen does not wrap any of its local headers in '#ifdef FOO...' logic to prevent problems where the same header is included more than once

the reason it fails on uClibc is because screen has a local file called 'sched.h' and it compiles with -I. ... uClibc happens to include pthread.h at one point which has an '#include <sched.h>' ... because of the -I., the local sched.h is used instead of the system one

then when screen.c pulls in screen.h which pulls in sched.h, we get the redefine error

solution here i think is to add proper ifdef protection to all of screen's local headers ... so in sched.h:
#ifndef _SCREEN_SCHED_H_
#define _SCREEN_SCHED_H_
...
#endif
Comment 8 Sergey Dryabzhinsky 2007-11-11 13:36:24 UTC
Created attachment 135740 [details, diff]
Just fix file paths...

Wrong file paths in diff header, so patch can't find them...
Fixed.
Comment 9 Danny Staple 2007-12-11 21:54:21 UTC
I am seeing exactly the same issue compiling against uclibc  0.9.28.3 on a PPC device. The build.log is identical in respect to where it fails - same struct, same error.
Comment 10 Sergey Dryabzhinsky 2008-03-16 11:00:44 UTC
Created attachment 146294 [details, diff]
Wrapping all local headers

As SpanKY mentioned no one local header in screen was not wrapped by defined "_SCREEN_*"... But now it will, I hope.
And thanks to Jens for pointing at 'sys/types.h' header.
Comment 11 Cristi Magherusan 2008-08-18 11:32:02 UTC
It's still broken as of August 18'th. Is there any chance for inclusion of the fix in the tree?
Comment 12 Tobias Leupold 2008-08-26 17:55:15 UTC
screen compiles and works fine on my NSLU2 with screen-4.0.3-wrap-local-headers.patch. Would be quite meaningful to at least include the patch for armeb-softfloat-linux-uclibc.
Comment 13 Anthony Giorgio 2009-01-07 20:01:35 UTC
This is broken for my as well on my NSLU2 with uclibc.  I'm trying the patch now.
Comment 14 Ingo Krabbe 2009-01-13 14:00:17 UTC
Created attachment 178365 [details, diff]
sched.h patch saved to files/screen-4.0.3-sched.patch

together with an ebuild change @screen-4.0.3.ebuild +66:

        # uclibc patch
        epatch "${FILESDIR}"/screen-4.0.3-sched.patch

and then do:

ebuild screen-4.0.3.ebuild manifest
Comment 15 Pacho Ramos gentoo-dev 2012-12-15 13:24:37 UTC
Still valid with 4.0.3-r7?
Comment 16 Patrice Clement gentoo-dev 2015-10-10 16:33:07 UTC
This version of screen is no more available in Portage. Please try again with the latest version available (4.3.1) and feel free to reopen this bug if you still experience it.
Comment 17 SpanKY gentoo-dev 2015-10-10 18:27:05 UTC
the build is still broken, but not exactly in this way.  filed bug 562752.