Bug 105858 - error while emerging app-arch/rzip-2.0-r1
Bug#: 105858 Product:  Gentoo/Alt Version: unspecified Platform: PPC
OS/Version: OS X Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: ppc-macos@gentoo.org Reported By: dirk.schoenberger@freenet.de
Component: Mac OSX
URL: 
Summary: error while emerging app-arch/rzip-2.0-r1
Keywords:  
Status Whiteboard: 
Opened: 2005-09-13 14:20 0000
Description:   Opened: 2005-09-13 14:20 0000
while trying to emerge rzip 2.0-r1 I ran into the following problem

checking for BZ2_bzBuffToBuffCompress in -lbz2... yes
checking for errno in errno.h... yes
checking for mmap... yes
checking for strerror... yes
checking for getopt_long... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
gcc -I. -I. -O2 -pipe -c rzip.c -o rzip.o
gcc -I. -I. -O2 -pipe -c runzip.c -o runzip.o
gcc -I. -I. -O2 -pipe -c main.c -o main.o
main.c: In function 'write_magic':
main.c:50: error: 'uint32_t' undeclared (first use in this function)
main.c:50: error: (Each undeclared identifier is reported only once
main.c:50: error: for each function it appears in.)
main.c:50: error: parse error before "v"
main.c:62: error: 'v' undeclared (first use in this function)
main.c: In function 'read_magic':
main.c:78: error: 'uint32_t' undeclared (first use in this function)
main.c:78: error: parse error before "v"
main.c:92: error: 'v' undeclared (first use in this function)
main.c: In function 'decompress_file':
main.c:143: warning: assignment makes pointer from integer without a cast
make: *** [main.o] Error 1
make: *** Waiting for unfinished jobs....

!!! ERROR: app-arch/rzip-2.0-r1 failed.
!!! Function src_compile, Line 567, Exitcode 2
!!! emake failed


Reproducible: Always
Steps to Reproduce:
1.
2.
3.




!!! Relying on the shell to locate gcc, this may break
!!! DISTCC, installing gcc-config and setting your current gcc
!!! profile will fix this
Portage 2.0.52-r1 (default-darwin/macos/10.4, gcc-4.0.0, libsystem-7.1-r0, 8.2.0 Power Macintosh)
===============================================================
==
System uname: 8.2.0 Power Macintosh powerpc
macos-20041118
distcc 2.0.1-zeroconf powerpc-apple-darwin7.0 (protocol 1) (default port 3632) [disabled]
dev-lang/python:     [Not Present]
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  [Not Present]
sys-devel/automake:  [Not Present]
sys-devel/binutils:  [Not Present]
sys-devel/libtool:   [Not Present]
virtual/os-headers:  7.1
ACCEPT_KEYWORDS="ppc-macos ~ppc-macos"
AUTOCLEAN="yes"
CBUILD="powerpc-apple-darwin"
CFLAGS="-O2 -pipe"
CHOST="powerpc-apple-darwin"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/
qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig collision-protect distlocks sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/
gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="ppc emboss imagemagick nls png ppc-macos sdl userland_Darwin kernel_Darwin elibc_Darwin"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

------- Comment #1 From Fabian Groffen 2005-09-15 10:14:08 0000 -------
Created an attachment (id=68517) [details]
rzip-2.0-darwin.patch

Weird.	I didn't get the error you report, though I got a problem with strndup
which is not available on BSD it seems.  So I made a simple patch which appears
to work for me, attached here.	I'd like to find out why you have those errors
which I don't have.

------- Comment #2 From Dirk Schoenberger 2005-09-15 15:11:15 0000 -------
> Weird.  I didn't get the error you report, though I got a problem with strndup
> which is not available on BSD it seems.  So I made a simple patch which appears
> to work for me, attached here.  I'd like to find out why you have those errors
> which I don't have.

Didn't work for me ;(
However, I could get it at least to compile if I add a

#include <stdint.h> in main.c or rzip.h

------- Comment #3 From Fabian Groffen 2005-09-16 00:31:23 0000 -------
do you have the latest XCode tools installed?

------- Comment #4 From Dirk Schoenberger 2005-09-16 14:12:19 0000 -------
> do you have the latest XCode tools installed?

XCode 2.0 (came with my Tiger CD)
Build 514, I suppose.


Latest is XCode 2.1, I think.

------- Comment #5 From Fabian Groffen 2005-09-16 14:45:18 0000 -------
but which one do you have installed?

I use XCode 2.1, build 621

------- Comment #6 From Dirk Schoenberger 2005-09-16 14:57:48 0000 -------
> but which one do you have installed?

XCode 2.0 (came with my Tiger CD)
Build 514

------- Comment #7 From Fabian Groffen 2005-09-16 15:00:00 0000 -------
Do you care about upgrading?  We only support the latest XCode tools, because
it
also solves a lot of linker problems.

------- Comment #8 From Dirk Schoenberger 2005-09-16 16:26:05 0000 -------
> Do you care about upgrading?  We only support the latest XCode tools, because it
> also solves a lot of linker problems.

Done upgrading to XCode 2.1
With the patch rzip emerges fine.

------- Comment #9 From Fabian Groffen 2005-09-17 00:44:41 0000 -------
Ok, then I will check this one on Pather today, and see if it works there too
with the latest Xcode available there.  I think I can check this in later today.
 Thanks for trying Dirk.

------- Comment #10 From Fabian Groffen 2005-09-17 04:29:53 0000 -------
compiled and worked on Panther also.

I am hestitant to put this in portage in the same ebuild.  ferringb, could you
advise on this patch whether to apply is unconditional or not, and put it in the
current ebuild, or in a -r2?  And do you agree with it?

------- Comment #11 From Brian Harring 2005-09-17 04:39:52 0000 -------
Yuck.
Conditionally pull in a strndup function is my preferred solution.

------- Comment #12 From Fabian Groffen 2005-09-17 08:17:02 0000 -------
Created an attachment (id=68679) [details]
extended patch that uses autoconf to check fort strndup

this patch uses autoconf to check for strndup and uses replacement code only
when not available.

------- Comment #13 From Fabian Groffen 2005-09-17 09:10:43 0000 -------
Created an attachment (id=68680) [details]
patches applied to the sources

Another attempt to fix the issue, this time a little bit decent.

I created a separate file that holds the strndup implementation.  It's header
file is now included by the main.c file.  The strndup code is optional based on
the existence of strndup according to configure.

------- Comment #14 From Fabian Groffen 2005-09-17 09:11:27 0000 -------
Created an attachment (id=68681) [details]
strutils.c

strutils.c file which implements strndup

------- Comment #15 From Fabian Groffen 2005-09-17 09:12:08 0000 -------
Created an attachment (id=68682) [details]
strutils.h

header file for strutils.c

------- Comment #16 From Fabian Groffen 2005-09-17 10:52:04 0000 -------
Created an attachment (id=68688) [details]
patched ebuild

these are my changes to the ebuild to get the previously supplied files and
patches working

------- Comment #17 From Dirk Schoenberger 2005-09-17 14:53:38 0000 -------
> these are my changes to the ebuild to get the previously supplied files and
> patches working

I think the code looks good, and the package emerges fine.

------- Comment #18 From Brian Harring 2005-09-21 20:57:19 0000 -------
Created an attachment (id=68987) [details]
cleaned up patch

Hola.  cleaned up the patch a bit, fixing up lot of old/icky autoconf crap with
it, and lack of DESTDIR make support.

please take it for a spin;

------- Comment #19 From Brian Harring 2005-09-21 20:58:55 0000 -------
Created an attachment (id=68988) [details]
updated ebuild patch.

------- Comment #20 From Dirk Schoenberger 2005-09-22 11:19:28 0000 -------
> Hola.  cleaned up the patch a bit, fixing up lot of old/icky autoconf crap with
> it, and lack of DESTDIR make support.

> please take it for a spin;

Emerges fine here.

------- Comment #21 From Brian Harring 2005-09-22 14:47:58 0000 -------
patch is in as rzip-2.0-r1, keyword at your leisure. ;)

------- Comment #22 From Fabian Groffen 2005-09-23 08:56:05 0000 -------
-r2 I assume/know for sure.

now also available for ~ppc-macos-xians

Brian, thanks for your additional patching/efforts!

------- Comment #23 From Stupid Bugzilla 2008-08-01 15:57:39 0000 -------
This "cleaned up" patch that is "fixing up lot of old/icky autoconf crap with
it" broke rzip on at least x86. See bug [217552]. And yes, I choose ugly but
working  over nice but breaking silently every time.