Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Blocker
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Environment:FreeBSD-HEAD, clang 3.1 & gcc 4.2.1, openjdk6 b25
Description
error when building with gcc
ICMPv6Socket.c: In function 'Java_org_opennms_protocols_icmp6_ICMPv6Socket_receive':
ICMPv6Socket.c:523: error: dereferencing pointer to incomplete type
ICMPv6Socket.c:523: error: 'ICMP6_ECHO_REPLY' undeclared (first use in this function)
ICMPv6Socket.c:523: error: (Each undeclared identifier is reported only once
ICMPv6Socket.c:523: error: for each function it appears in.)
ICMPv6Socket.c: In function 'Java_org_opennms_protocols_icmp6_ICMPv6Socket_send':
ICMPv6Socket.c:776: error: dereferencing pointer to incomplete type
ICMPv6Socket.c:776: error: 'ICMP6_ECHO_REQUEST' undeclared (first use in this function)
ICMPv6Socket.c:789: error: dereferencing pointer to incomplete type
Build process with clang
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for gcc... clang
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of clang... gcc3
checking whether ln -s works... yes
checking build system type... amd64-portbld-freebsd10.0
checking host system type... amd64-portbld-freebsd10.0
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by clang... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... (cached) 262144
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... no
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from clang object... ok
checking how to run the C preprocessor... clang-cpp
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if clang supports -fno-rtti -fno-exceptions... yes
checking for clang option to produce PIC... -fPIC -DPIC
checking if clang PIC flag -fPIC -DPIC works... yes
checking if clang static flag -static works... yes
checking if clang supports -c -o file.o... yes
checking if clang supports -c -o file.o... (cached) yes
checking whether the clang linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... freebsd10.0 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether byte ordering is bigendian... no
configure: searching for a 1.5 JDK
configure: trying the value in JAVA_HOME
configure: checking if /usr/local/openjdk6 is home for a valid 1.5 JDK
checking if /usr/local/openjdk6 has java... yes
checking if /usr/local/openjdk6 has javac... yes
checking if /usr/local/openjdk6 has jar... yes
checking if /usr/local/openjdk6 has javah... yes
checking if java version meets requirements for 1.5... yes, version is 1.6
checking if java architecture meets requirements... yes, 64-bit
checking for jni headers... yes
configure: found a valid JDK. setting JAVA_HOME to /usr/local/openjdk6
checking for java... /usr/local/bin/java
configure: using JDK at /usr/local/openjdk6
checking if clang is Sun CC... no
./configure: rpm: not found
checking for rpmbuild... no
*** RPM Configuration Failed
*** Failed to find the rpmbuild program. If you want to build rpm packages
*** indicate the path to the rpmbuild program using --with-rpmbuild-prog=PROG
JAVA_HOME=/usr/local/openjdk6
JAVA=/usr/local/openjdk6/bin/java
JAVAC=/usr/local/openjdk6/bin/javac
JAVAH=/usr/local/openjdk6/bin/javah
JAR=/usr/local/openjdk6/bin/jar
JNI_INCLUDES=-I/usr/local/openjdk6/include -I/usr/local/openjdk6/include/freebsd
checking for ANSI C header files... (cached) yes
checking jni.h usability... yes
checking jni.h presence... yes
checking for jni.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for netinet/icmp6.h... no
checking for sys/types.h... (cached) yes
checking for AvailabilityMacros.h... no
checking for libkern/OSByteOrder.h... no
checking for architecture/byte_order.h... no
checking for byteswap.h... yes
checking for errno.h... yes
checking for malloc.h... no
checking for netdb.h... yes
checking for stdlib.h... (cached) yes
checking for sys/byteorder.h... no
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking winsock2.h usability... no
checking winsock2.h presence... no
checking for winsock2.h... no
checking ws2tcpip.h usability... no
checking ws2tcpip.h presence... no
checking for ws2tcpip.h... no
checking for socklen_t... yes
checking for an ANSI C-conforming const... yes
checking for getenv... yes
checking for struct timeval... yes
checking for byteswap.h... (cached) yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating jicmp6.spec
config.status: creating pom.xml
config.status: creating solaris/pkginfo
config.status: creating debian/control
config.status: creating tests.sh
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
===> Building for jicmp6-1.0.1
make all-am
mkdir -p classes
/usr/local/openjdk6/bin/javac -source 1.5 -target 1.5 -d classes org/opennms/protocols/icmp6/ICMPv6Packet.java org/opennms/protocols/icmp6/ICMPv6EchoPacket.java org/opennms/protocols/icmp6/ICMPv6EchoRequest.java org/opennms/protocols/icmp6/ICMPv6EchoReply.java org/opennms/protocols/icmp6/ICMPv6Socket.java && touch java.built
/usr/local/openjdk6/bin/javah -classpath classes org.opennms.protocols.icmp6.ICMPv6Socket
/bin/sh ./libtool --tag=CC --mode=compile clang -DHAVE_CONFIG_H -I. -I/usr/local/openjdk6/include -I/usr/local/openjdk6/include/freebsd -I. -I. -I/usr/local/openjdk6/include -I/usr/local/openjdk6/include/freebsd -I. -O2 -pipe -fno-omit-frame-pointer -fno-strict-aliasing -m64 -Wall -MT ICMPv6Socket.lo -MD -MP -MF .deps/ICMPv6Socket.Tpo -c -o ICMPv6Socket.lo ICMPv6Socket.c
libtool: compile: clang -DHAVE_CONFIG_H -I. -I/usr/local/openjdk6/include -I/usr/local/openjdk6/include/freebsd -I. -I. -I/usr/local/openjdk6/include -I/usr/local/openjdk6/include/freebsd -I. -O2 -pipe -fno-omit-frame-pointer -fno-strict-aliasing -m64 -Wall -MT ICMPv6Socket.lo -MD -MP -MF .deps/ICMPv6Socket.Tpo -c ICMPv6Socket.c -fPIC -DPIC -o .libs/ICMPv6Socket.o
[1mICMPv6Socket.c:518:14: [0m[0;1;31merror: [0m[1mincomplete definition of type 'struct icmp6_hdr'[0m
&& icmp6Hdr->icmp6_type == ICMP6_ECHO_REPLY
[0;1;32m ~~~~~~~~^
[0m[1mICMPv6Socket.c:436:9: [0m[0;1;30mnote: [0mforward declaration of 'struct icmp6_hdr'[0m
struct icmp6_hdr * icmp6Hdr = NULL;
[0;1;32m ^
[0m[1mICMPv6Socket.c:518:30: [0m[0;1;31merror: [0m[1muse of undeclared identifier 'ICMP6_ECHO_REPLY'[0m
&& icmp6Hdr->icmp6_type == ICMP6_ECHO_REPLY
[0;1;32m ^
[0m[1mICMPv6Socket.c:771:37: [0m[0;1;31merror: [0m[1mincomplete definition of type 'struct icmp6_hdr'[0m
&& ((struct icmp6_hdr *)outBuffer)->icmp6_type == ICMP6_ECHO_REQUEST
[0;1;32m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
[0m[1mICMPv6Socket.c:771:15: [0m[0;1;30mnote: [0mforward declaration of 'struct icmp6_hdr'[0m
&& ((struct icmp6_hdr *)outBuffer)->icmp6_type == ICMP6_ECHO_REQUEST
[0;1;32m ^
[0m[1mICMPv6Socket.c:771:53: [0m[0;1;31merror: [0m[1muse of undeclared identifier 'ICMP6_ECHO_REQUEST'[0m
&& ((struct icmp6_hdr *)outBuffer)->icmp6_type == ICMP6_ECHO_REQUEST
[0;1;32m ^
[0m[1mICMPv6Socket.c:784:34: [0m[0;1;31merror: [0m[1mincomplete definition of type 'struct icmp6_hdr'[0m
((struct icmp6_hdr *)outBuffer)->icmp6_cksum = 0;
[0;1;32m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
[0m[1mICMPv6Socket.c:771:15: [0m[0;1;30mnote: [0mforward declaration of 'struct icmp6_hdr'[0m
&& ((struct icmp6_hdr *)outBuffer)->icmp6_type == ICMP6_ECHO_REQUEST
[0;1;32m ^
[0m5 errors generated.
*** [ICMPv6Socket.lo] Error code 1
Attached patch resolves the issue on FreeBSD-HEAD r236725M
http://www.geeklan.co.uk/?p=132&cpage=2#comment-153531