New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #35619 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

sdcc: error: conflicting types for 'getline'

Reported by: fabrizio.giuliano@… Owned by: snc@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc:
Port: sdcc29

Description

I tried to install sdcc @2.9.0_0 in this way:

svn co -r 57740 http://svn.macports.org/repository/macports/trunk/dports/lang/sdcc
cd sdcc
sudo port install
--->  Building sdcc
Error: org.macports.build for port sdcc returned: command execution failed
Please see the log file for port sdcc for details:
    /opt/local/var/macports/logs/_private_tmp_sdcc/sdcc/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port sdcc failed

Attachments

main.log (39.0 KB) - added by fabrizio.giuliano@… 10 months ago.
main.log

Change History

Changed 10 months ago by fabrizio.giuliano@…

main.log

comment:1 Changed 10 months ago by ryandesign@…

  • Owner changed from macports-tickets@… to snc@…
  • Port set to sdcc
  • Summary changed from sdcc @2.9.0_0 building error to sdcc: error: conflicting types for 'getline'

comment:2 Changed 10 months ago by ryandesign@…

Wait, why are you deliberately checking out a three-year-old version of the port? Use the current version of the port, please; it should build fine.

comment:3 Changed 10 months ago by ryandesign@…

  • Status changed from new to closed
  • Resolution set to wontfix

If you're deliberately trying to install an older version of the port, that's fine, but you might run into some problems that have been fixed in later versions. And this is one of those problems. On Lion and later, it's not legal to define a function with the name "getline", because Lion already defines function of that name. The developers of sdcc already fixed this in version 3.0, and MacPorts fixed it by updating the port to that version. If you must have sdcc 2.9, then you could manually apply the patch. Here's what the ChangeLog says about how they fixed it:

2009-05-03 Borut Razem <borut.razem AT siol.net>

	* as/link/hc08/Makefile.in, as/link/mcs51/Makefile.in,
	  as/link/z80/Makefile.in, as/link/lk_readnl.c, as/link/lk_readnl.h,
	  as/link/lklib.c, as/link/lkrel.c, as/link/lksdcclib.c:
	  getline renamed to lk_readln to prevent conflicts with Fedora 11
	  glibc-2.9.90-19 getline;
	  see https://bugzilla.redhat.com/show_bug.cgi?id=488217

comment:4 Changed 10 months ago by cal@…

There also is a sdcc29 port if you need a version < 3; it has the fix mentioned, but only for lion. It would probably have to be adapted to use this fix on mountain lion, too. Please file a bug against the sdcc29 port if that's what you want.

comment:5 Changed 10 months ago by fabrizio.giuliano@…

Thank you! i did:

sudo port install sdcc29
sudo port edit sdcc29

Insert this snippet (it works with Mountain Lion):

platform darwin 12 {
    post-patch {
        # 10.7 provides 'getline()' already, but it is not
        # interchangeable with that provided by SDCC. change SDCC's
        # internal to "sdcc_getline", but not the #includes
        reinplace "/getline/s@getline @sdcc_getline @g" \
            ${worksrcpath}/as/link/getline.h \
            ${worksrcpath}/as/link/getline.c \
            ${worksrcpath}/as/link/lklib.c \
            ${worksrcpath}/as/link/lkrel.c \
            ${worksrcpath}/as/link/lksdcclib.c
    }
}

It works!

Thanks a lot again!

comment:6 Changed 10 months ago by cal@…

  • Status changed from closed to reopened
  • Resolution wontfix deleted
  • Port changed from sdcc to sdcc29

comment:7 Changed 10 months ago by cal@…

  • Status changed from reopened to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.