ports/104064: palm/libmal: fails to build when palm/pilot-link compiled with threads and usb support

Scot Hetzel swhetzel at gmail.com
Fri Oct 6 15:00:46 UTC 2006


>Number:         104064
>Category:       ports
>Synopsis:       palm/libmal: fails to build when palm/pilot-link compiled with threads and usb support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 06 15:00:44 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Scot Hetzel
>Release:        FreeBSD 6.1-STABLE
>Organization:
Ye Old Computer
>Environment:
>Description:
When I tried to update libmal to 0.42 with portmaster, I enabled the OPTIONS
PNG, THREADS, and USB in the palm/pilot-link port.  This caused palm/libmal to fail to build due to libpisock.so was compiled with thread support.

(cd .libs && rm -f libmal.la && ln -s ../libmal.la libmal.la)
if cc -DHAVE_CONFIG_H -I. -I. -I..    -Wall -g -DMALSYNC  -I../malsync/mal/common -I../malsync/mal/client/common -I../malsync/mal/client/unix  -I/usr/local/include  -MT malsync.o -MD -MP -MF ".deps/malsync.Tpo" -c -o malsync.o malsync.c; \
        then mv -f ".deps/malsync.Tpo" ".deps/malsync.Po"; else rm -f ".deps/malsync.Tpo"; exit 1; fi
/bin/sh ../libtool --tag=CC --mode=link cc -Wall -g -DMALSYNC  -I../malsync/mal/common -I../malsync/mal/client/common -I../malsync/mal/client/unix  -I/usr/local/include    -o malsync  malsync.o -L/usr/local/lib -lpisock libmal.la

*** Warning: Linking the executable malsync against the loadable module
*** libmal.so is not portable!
cc -Wall -g -DMALSYNC -I../malsync/mal/common -I../malsync/mal/client/common -I../malsync/mal/client/unix -I/usr/local/include -o .libs/malsync malsync.o  -L/usr/local/lib ./.libs/libmal.so -lpisock -Wl,--rpath -Wl,/usr/local/lib
/usr/local/lib/libpisock.so: undefined reference to `pthread_create'
/usr/local/lib/libpisock.so: undefined reference to `pthread_cancel'
/usr/local/lib/libpisock.so: undefined reference to `pthread_setcanceltype'
/usr/local/lib/libpisock.so: undefined reference to `pthread_cond_timedwait'
gmake[2]: *** [malsync] Error 1
gmake[2]: Leaving directory `/usr/ports/palm/libmal/work/libmal-0.42/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/ports/palm/libmal/work/libmal-0.42'
gmake: *** [all] Error 2
*** Error code 2

Stop in /usr/ports/palm/libmal.

I believe this problem may be showing up do to the following conditions in the palm/pilot-link port:

When THREADS is selected, LDFLAGS are set to PTHREAD_LIBS, but are not added to the CONFIGURE_ENV.

Then when USB is selected, additional options are added to LDFLAGS, and then the CONFIGURE_ENV is set to use the LDFLAGS during the configure stage.




>How-To-Repeat:
Install the palm/pilot-link port with both THREADS and USB enabled.
Then try to build palm/libmal.

>Fix:
The fix for palm/pilot-link is to change:

.if defined(WITH_USB)
LIB_DEPENDS+=   usb-0.1.8:${PORTSDIR}/devel/libusb
CONFIGURE_ARGS+=--enable-libusb
CONFIGURE_ENV+="LDFLAGS=${LDFLAGS} -L${PREFIX}/lib -lusb"
.endif

to

.if defined(WITH_USB)
LIB_DEPENDS+=   usb-0.1.8:${PORTSDIR}/devel/libusb
CONFIGURE_ARGS+=--enable-libusb
LDFLAGS+=-L${PREFIX}/lib -lusb"
.endif
CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"

This would then allow PTHREAD_LIBS to pass to the configure stage.

Then add the following to the palm/libmal port:

OPTIONS=        THREADS "built-in thread safety" on

.if !defined(WITHOUT_THREADS)
LDFLAGS+=      ${PTHREAD_LIBS}
CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
.endif

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list