libmatthew-java 0.7.1-1 refuse to build

Bug #239765 reported by Sveinung Kvilhaugsvik
2
Affects Status Importance Assigned to Milestone
libmatthew-java (Debian)
Fix Released
Unknown
libmatthew-java (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The reason is that LDFLAGS is set to -Wl,-Bsymbolic-functions.

From the build log:
ld -Wl,-Bsymbolic-functions -fpic -shared -lc -o libcgi-java.so cgi-java.o
ld: unrecognized option '-Wl,-Bsymbolic-functions'
ld: use the --help option for usage information

Revision history for this message
Sveinung Kvilhaugsvik (kvilhaugsvik) wrote :

Seems like I was wrong. It will fail even if the default flags are blocked:

From the build log after blanking out the flags from dpkg-buildpackage
ld -o libcgi-java.so cgi-java.o
ld: warning: cannot find entry symbol _start; defaulting to 00000000004000e8
cgi-java.o: In function `Java_cx_ath_matthew_cgi_CGI_getfullenv':
/tmp/buildd/libmatthew-java-0.7.1/cgi-java.c:30: undefined reference to `environ'
/tmp/buildd/libmatthew-java-0.7.1/cgi-java.c:34: undefined reference to `environ'
cgi-java.o: In function `Java_cx_ath_matthew_cgi_CGI_getenv':
/tmp/buildd/libmatthew-java-0.7.1/cgi-java.c:42: undefined reference to `getenv'

Revision history for this message
Sveinung Kvilhaugsvik (kvilhaugsvik) wrote :

(it also get the same error if only -Wl is removed)

Changed in libmatthew-java:
status: Unknown → Fix Released
Revision history for this message
Sveinung Kvilhaugsvik (kvilhaugsvik) wrote :

When
LDFLAGS="-Bsymbolic-functions -fpic -shared -lc" \
is added it don't have problem with ld any longer, but gives the error.

cc -g -O2 -fpic -Wall -Os -pedantic -std=c99 -Werror -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -c -o unix-java.o unix-java.c
unix-java.c: In function 'Java_cx_ath_matthew_unix_UnixSocket_native_1getPID':
unix-java.c:297: error: storage size of 'cr' isn't known
cc1: warnings being treated as errors
unix-java.c:297: error: unused variable 'cr'
unix-java.c: In function 'Java_cx_ath_matthew_unix_UnixSocket_native_1getUID':
unix-java.c:318: error: storage size of 'cr' isn't known
unix-java.c:318: error: unused variable 'cr'
unix-java.c: In function 'Java_cx_ath_matthew_unix_UnixSocket_native_1getGID':
unix-java.c:339: error: storage size of 'cr' isn't known
unix-java.c:339: error: unused variable 'cr'
make[1]: *** [unix-java.o] Error 1

The same modification builds fine in sid.

Revision history for this message
Sveinung Kvilhaugsvik (kvilhaugsvik) wrote :

Adding -D_GNU_SOURCE (to get acess to ucred that is cr's type) to the cflags fixes this, but brings on a new problem.

echo "Class-Path: /usr/share/java/hexdump.jar" > Manifest
(cd classes;jar cfm ../debug-disable-1.1.jar ../Manifest cx/ath/matthew/debug/*.class)
(cd classes; /usr/bin/fastjar cf ../io-0.1.jar cx/ath/matthew/io/*class)
(cd classes; /usr/bin/fastjar cf ../hexdump-0.2.jar cx/ath/matthew/utils/Hexdump.class)
/usr/lib/jvm/default-java/bin/javah -classpath classes -o cgi-java.h cx.ath.matthew.cgi.CGI
cc -D_GNU_SOURCE -fpic -Wall -Os -pedantic -std=c99 -Werror -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -c -o cgi-java.o cgi-java.c
ld -Bsymbolic-functions -fpic -shared -lc -o libcgi-java.so cgi-java.o
/usr/lib/jvm/default-java/bin/javah -classpath classes -o unix-java.h cx.ath.matthew.unix.UnixServerSocket cx.ath.matthew.unix.UnixSocket cx.ath.matthew.unix.USInputStream cx.ath.matthew.unix.USOutputStream
cc -D_GNU_SOURCE -fpic -Wall -Os -pedantic -std=c99 -Werror -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux -c -o unix-java.o unix-java.c
unix-java.c: In function 'Java_cx_ath_matthew_unix_UnixSocket_native_1send_1creds':
unix-java.c:384: error: request for member 'pid' in something not a structure or union
unix-java.c:385: error: request for member 'uid' in something not a structure or union
unix-java.c:386: error: request for member 'gid' in something not a structure or union
unix-java.c: In function 'Java_cx_ath_matthew_unix_UnixSocket_native_1recv_1creds':
unix-java.c:415: error: conflicting types for 'buf'
unix-java.c:402: error: previous definition of 'buf' was here
unix-java.c:425: error: 'msgh' undeclared (first use in this function)
unix-java.c:425: error: (Each undeclared identifier is reported only once
unix-java.c:425: error: for each function it appears in.)
cc1: warnings being treated as errors
unix-java.c:435: error: passing argument 5 of '(*env)->SetIntArrayRegion' from incompatible pointer type
unix-java.c:439: error: return makes integer from pointer without a cast
unix-java.c:439: error: function returns address of local variable
make[1]: *** [unix-java.o] Error 1

Revision history for this message
Sveinung Kvilhaugsvik (kvilhaugsvik) wrote :

-D_GNU_SOURCE introduces the same problem on Debian so I guess that is not the solution

Revision history for this message
Michael Bienia (geser) wrote :

I've managed to fix some of the errors in unix-java.c:

lines 384-386:
a creds is a pointer to a struct (see line 383), it should be creds->pid instead of creds.pid (the same for gid and uid)

lines 425 and 427:
replace msgh with msg

But I didn't figure out yet how to fix the other errors:
line 415:
buf is declared here to be char array while in line 402 is a simple char
I don't know how this should match the return type of "jbyte" (the error in line 439)

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

Please find attached a debdiff incorporating all the suggestions with additional few of my own.

Revision history for this message
Onkar Shinde (onkarshinde) wrote :

Marking as confirmed since debdiff is attached.

Changed in libmatthew-java:
status: New → Confirmed
Revision history for this message
Daniel Holbach (dholbach) wrote :

Could you please forward the additional changes to upstream?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libmatthew-java - 0.7.1-1ubuntu1

---------------
libmatthew-java (0.7.1-1ubuntu1) intrepid; urgency=low

  * Fix for FTBFS. (LP: #239765)
  * debian/control
    - Remove unneeded build dependency classpath-doc.
    - Modify 'Maintainer' field.
  * debian/rules
    - Change source option value from 5.0 to 1.5
  * Makefile
    - Remove -Werror compiler flag.
    - Add -D_GNU_SOURCE compiler flag.
    - Set LDFLAGS appropriately.
  * unix-java.c
    - Various source modifications to fix compile time errors.

 -- Onkar Shinde <email address hidden> Sat, 13 Sep 2008 22:24:23 +0530

Changed in libmatthew-java:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.