Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 270621 - dev-embedded/sdcc-2.9.0 (version bump)
Summary: dev-embedded/sdcc-2.9.0 (version bump)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Embedded Team (OBSOLETE)
URL: http://sdcc.sourceforge.net/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-20 19:27 UTC by Karl H
Modified: 2010-10-09 07:04 UTC (History)
3 users (show)

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


Attachments
Build patch for sdcc-2.9.0 to build with glibc-2.10.1. (sdcc-2.9.0.patch,936 bytes, patch)
2009-07-20 14:09 UTC, Kjell Claesson
Details | Diff
A patch to fix the UCSim compile error under GCC-4.4 (sdcc-2.9.0-cmdlex-cstdio.patch,383 bytes, patch)
2010-08-03 06:15 UTC, Christopher Head
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karl H 2009-05-20 19:27:11 UTC
SDCC 2.9.0 Feature List:

    * sdcpp synchronized with GNU cpp 4.3.3
    * Integer constants written in binary (prefix 0b or 0B, followed by a sequence of 0 and 1digits) are now supported as a SDCC extension.
    * pic16 *printf() library functions return int
    * disabled support of undocumented and not standard compliant 'b' binary format specifier ("%b", "%hb" and "%lb") in pic16 *printf() and printf_tiny() library functions
    * fixed initialization of unnamed bitfields members of objects of structure and union type
    * many optimizations to reduce code size and increase speed in the Z80 backend
    * added support for ar format libraries to adcc asxxxx
    * libraries, included in sdcc packages, are in ar format
    * sdcc asxxxx license changed to GPLv3
    * added support for many PIC16 devices
Comment 1 Robin Kauffman 2009-07-18 07:11:54 UTC
Hi-
    It seems that sdcc 2.9.0 will not compile against glibc 2.10.1 due to the lack of a libcmd (which sdcc 2.8.0 didn't need).  I'm trying to figure out how to customize the ebuild or supply a patch without deviating too far from what upstream intends for this package.  If anyone has an idea or a suggestion for a ebuild/patch I'd be very appreciative.

        -Robin K.

(In reply to comment #0)
> SDCC 2.9.0 Feature List:
> 
>     * sdcpp synchronized with GNU cpp 4.3.3
>     * Integer constants written in binary (prefix 0b or 0B, followed by a
> sequence of 0 and 1digits) are now supported as a SDCC extension.
>     * pic16 *printf() library functions return int
>     * disabled support of undocumented and not standard compliant 'b' binary
> format specifier ("%b", "%hb" and "%lb") in pic16 *printf() and printf_tiny()
> library functions
>     * fixed initialization of unnamed bitfields members of objects of structure
> and union type
>     * many optimizations to reduce code size and increase speed in the Z80
> backend
>     * added support for ar format libraries to adcc asxxxx
>     * libraries, included in sdcc packages, are in ar format
>     * sdcc asxxxx license changed to GPLv3
>     * added support for many PIC16 devices
> 

Comment 2 Kjell Claesson 2009-07-20 14:09:29 UTC
Created attachment 198616 [details, diff]
Build patch for sdcc-2.9.0 to build with glibc-2.10.1.

Try adding the attached patch to the epatch in the ebuild.
It builds and work for me.

        # Fix automagic C{,XX}FLAGS
        epatch "${FILESDIR}"/sdcc-2.8.0-flags.patch
        epatch "${FILESDIR}"/${P}.patch

Don't know if the flag patch is needed.
Comment 3 Kjell Claesson 2009-07-21 05:32:21 UTC
Missed my emerge --info.

Portage 2.1.6.13 (default/linux/amd64/2008.0/desktop, gcc-4.3.3, glibc-2.10.1-r0, 2.6.30-gentoo-r3 x86_64)
=================================================================                                         
System uname: Linux-2.6.30-gentoo-r3-x86_64-Intel-R-_Pentium-R-_Dual_CPU_E2180_@_2.00GHz-with-gentoo-2.0.1
Timestamp of tree: Sun, 19 Jul 2009 14:00:01 +0000                                                        
app-shells/bash:     4.0_p24                                                                              
dev-java/java-config: 2.1.8-r1                                                                            
dev-lang/python:     2.6.2-r1                                                                             
dev-util/cmake:      2.6.4-r1                                                                             
sys-apps/baselayout: 2.0.1                                                                                
sys-apps/openrc:     0.4.3-r3                                                                             
sys-apps/sandbox:    2.0                                                                                  
sys-devel/autoconf:  2.13, 2.63-r1                                                                        
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11                                      
sys-devel/binutils:  2.19.1-r1                                                                            
sys-devel/gcc-config: 1.4.1                                                                               
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.mdfnet.se/mirror/gentoo http://ftp.ing.umu.se/linux/gentoo/ http://ftp.ds.karen.hj.se/gentoo/ http://ftp.df.lth.se/pub/gentoo/ "
LANG="sv_SE.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="sv"
MAKEOPTS="-j3"

The only thing the build was choking on for me, was the already defined getline
from glibc.
Comment 4 Robin Kauffman 2010-06-19 03:08:11 UTC
Hi-
    I've tested the patch and the build still fails as it's trying to link against -lcmd and failing.  I do not have a libcmd anywhere on my system and looking at systems with older versions of glibc it is glibc that seems to have the libcmd library.  If I'm missing something let me know.  This was a compile attempt against glibc 2.11(.0) on a fairly recent and up-to-date Gentoo system (GCC 4.4.3).

        -Robin K.

(In reply to comment #2)
> Created an attachment (id=198616) [details]
> Build patch for sdcc-2.9.0 to build with glibc-2.10.1.
> 
> Try adding the attached patch to the epatch in the ebuild.
> It builds and work for me.
> 
>         # Fix automagic C{,XX}FLAGS
>         epatch "${FILESDIR}"/sdcc-2.8.0-flags.patch
>         epatch "${FILESDIR}"/${P}.patch
> 
> Don't know if the flag patch is needed.
> 

Comment 5 Peter Fox 2010-06-28 22:10:26 UTC
I've found a load of patches for debian and fedora for this.
See the link from http://packages.debian.org/squeeze/sdcc for debian, or 
https://bugzilla.redhat.com/show_bug.cgi?id=488217 for fedora.
It compiled ok with an ebuild based on the debian changes. I'll try fedora next.
I'm still on gcc-4.3.4, but glibc-2.11.1.
Comment 6 Peter Fox 2010-06-28 22:50:44 UTC
Builds fine with the fedora patch too, and as it seems the simpler patch perhaps use that?
Comment 7 Christopher Head 2010-08-03 06:14:55 UTC
(In reply to comment #4)
> Hi-
>     I've tested the patch and the build still fails as it's trying to link
> against -lcmd and failing.  I do not have a libcmd anywhere on my system and
> looking at systems with older versions of glibc it is glibc that seems to have
> the libcmd library.  If I'm missing something let me know.  This was a compile
> attempt against glibc 2.11(.0) on a fairly recent and up-to-date Gentoo system
> (GCC 4.4.3).
> 
>         -Robin K.

The "-lcmd" issue has nothing to do with GLibc or a system-wide libcmd. The libcmd in question actually comes from inside SDCC. The problem is that there's a compile error inside this libcmd which is apparently ignored by the Makefile, and then the attempt to link to said libcmd (which due to the compile error was never created) causes the final error. I just happened to be lucky enough to notice the earlier error!

I reported the actual underlying bug here: <https://sourceforge.net/tracker/?func=detail&aid=3038644&group_id=599&atid=300599>. I will attach a copy of the patch file that fixes it here, too.

The reason some people see this and others don't is most likely nothing to do with GLibc but rather to do with GCC: the error is a missing #include, and newer versions of GCC are stricter around those than older versions were. I'm running 4.4.
Comment 8 Christopher Head 2010-08-03 06:15:41 UTC
Created attachment 241193 [details, diff]
A patch to fix the UCSim compile error under GCC-4.4
Comment 9 Christopher Head 2010-08-03 07:20:27 UTC
Note also that SDCC-2.9.0 requires GPUtils 0.13.7 to compile the PIC16 port's standard library. Bumping GPUtils to 0.13.7 is the subject of bug #275510.
Comment 10 SpanKY gentoo-dev 2010-10-08 09:38:43 UTC
now in the tree ... thanks !