Bug 73964 - [ports/graphics/netpbm] fix build error
Summary: [ports/graphics/netpbm] fix build error
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dirk Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-15 09:50 UTC by Sunpoet Po-Chuan Hsieh
Modified: 2004-11-17 05:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sunpoet Po-Chuan Hsieh 2004-11-15 09:50:39 UTC
The missing declaration of variable "col" breaks the build of netpbm.

gcc -c -I/usr/ports/works/usr/ports/graphics/netpbm/work/netpbm-10.25/lib -I. -DNDEBUG -O2 -pipe -s -march=pentium4 -fpic -DPIC \
    -o libpbm3.lo libpbm3.c
libpbm3.c: In function `packBitsWithMmxSse':
libpbm3.c:83: error: `col' undeclared (first use in this function)
libpbm3.c:83: error: (Each undeclared identifier is reported only once
libpbm3.c:83: error: for each function it appears in.)
libpbm3.c:86: warning: cast to pointer from integer of different size
gmake[1]: *** [libpbm3.lo] Error 1
gmake[1]: Leaving directory `/usr/ports/works/usr/ports/graphics/netpbm/work/netpbm-10.25/lib'
gmake: *** [lib/all] Error 2
*** Error code 2

Stop in /usr/ports/graphics/netpbm.

How-To-Repeat: % cd /usr/ports/graphics/netpbm
% make
Comment 1 jmeyer 2004-11-15 22:34:19 UTC
Hi all,

The same bug has bitten me on my 5.3 system.

This is apparently a known issue, per the netpbm-10.25 release notes
@ http://sourceforge.net/project/shownotes.php?release_id=275719:

"libpbm3.c won't compile if you use a -msse Gcc compile flag.
  The error is "undefined variable 'col'."  You need to add the
 declaration "int c;"."

In fact, that doesn't appear to be totally correct; you need to simply
declare "int col;"

The port compiles successfully with the following patch, though I have
not tested it yet:

--- lib/libpbm3.c       Fri Oct  1 08:56:33 2004
+++ lib/libpbm3.c.patch Mon Nov 15 15:24:59 2004
@@ -80,6 +80,8 @@

     di const zero64 = 0;        /* to clear with PXOR */

+    int col;
+
     for (col =0; col < cols-7; col += 8)
         packedBits[col/8]
           = bitreverse [ ~ (unsigned char) __builtin_ia32_pmovmskb (


-- 
Justin
Comment 2 Pav Lucistnik freebsd_committer freebsd_triage 2004-11-15 23:19:21 UTC
Responsible Changed
From-To: freebsd-ports-bugs->dinoex

Over to maintainer
Comment 3 dirk.meyer 2004-11-17 05:24:53 UTC
> cc -c -I/usr/ports/graphics/netpbm/work/netpbm-10.25/lib -I. -DNDEBUG -g -O=
>  -pipe  -fpic -DPIC \
>     -o libpbm3.lo libpbm3.c
> libpbm3.c: In function `packBitsWithMmxSse':
> libpbm3.c:83: error: `col' undeclared (first use in this function)
> libpbm3.c:83: error: (Each undeclared identifier is reported only once
> libpbm3.c:83: error: for each function it appears in.)
> gmake[1]: *** [libpbm3.lo] Error 1

It builds fine with FreeBSD-4.10 and FreeBSD-5.3 default.

Pleae verfiy if the patch in
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/73964

solves your problem.

kind regards Dirk

- Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
- [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org]
Comment 4 Dirk Meyer freebsd_committer freebsd_triage 2004-11-17 05:46:46 UTC
State Changed
From-To: open->closed

committed, thanks.
Comment 5 Sean McNeil 2004-11-17 05:49:13 UTC
On Wed, 2004-11-17 at 06:24 +0100, Dirk Meyer wrote:
> > cc -c -I/usr/ports/graphics/netpbm/work/netpbm-10.25/lib -I. -DNDEBUG -g -O=
> >  -pipe  -fpic -DPIC \
> >     -o libpbm3.lo libpbm3.c
> > libpbm3.c: In function `packBitsWithMmxSse':
> > libpbm3.c:83: error: `col' undeclared (first use in this function)
> > libpbm3.c:83: error: (Each undeclared identifier is reported only once
> > libpbm3.c:83: error: for each function it appears in.)
> > gmake[1]: *** [libpbm3.lo] Error 1
> 
> It builds fine with FreeBSD-4.10 and FreeBSD-5.3 default.
> 
> Pleae verfiy if the patch in
> http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/73964
> 
> solves your problem.


Yes, that does indeed solve my problem.  Thanks

Cheers,
Sean