[tcpdump-workers] Libpcap 1.3.0 not building on OpenBSD 5.2 sparc64

2012-12-10 Thread Kaya Saman

Hi,

I'm trying to build libpcap 1.3.0 on my Sun Fire V210 running OpenBSD 
5.2 however, I keep getting errors??


The configuration script doesn't come up with anything claiming to be an 
error however, if I run 'make' afterwards I get this:


# make
VER=`cat ./VERSION`;  MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' 
./VERSION`;  gcc -shared -Wl,-soname,libpcap.so.$MAJOR_VER   -o 
libpcap.so.$VER pcap-bpf.o fad-getad.o pcap.o inet.o gencode.o 
optimize.o nametoaddr.o etherent.o savefile.o sf-pcap.o sf-pcap-ng.o 
pcap-common.o bpf_image.o bpf_dump.o  scanner.o grammar.o bpf_filter.o 
version.o

scanner.o(.text+0x3b8): In function `pcap__load_buffer_state':
/home/libpcap-1.3.0/scanner.c:4207: relocation truncated to fit: 
R_SPARC_GOT13 yy_n_chars
scanner.o(.text+0x3dc):/home/libpcap-1.3.0/scanner.c:4209: relocation 
truncated to fit: R_SPARC_GOT13 pcap_in
scanner.o(.text+0x3e8):/home/libpcap-1.3.0/scanner.c:4210: relocation 
truncated to fit: R_SPARC_GOT13 yy_hold_char

scanner.o(.text+0x42c): In function `pcap__switch_to_buffer':
/home/libpcap-1.3.0/scanner.c:4184: relocation truncated to fit: 
R_SPARC_GOT13 yy_hold_char
scanner.o(.text+0x43c):/home/libpcap-1.3.0/scanner.c:4186: relocation 
truncated to fit: R_SPARC_GOT13 yy_n_chars
scanner.o(.text+0x454):/home/libpcap-1.3.0/scanner.c:4197: relocation 
truncated to fit: R_SPARC_GOT13 yy_did_buffer_switch_on_eof

scanner.o(.text+0x558): In function `yy_fatal_error':
/home/libpcap-1.3.0/scanner.c:4488: relocation truncated to fit: 
R_SPARC_GOT13 .LC0

scanner.o(.text+0x620): In function `pcap__scan_buffer':
/home/libpcap-1.3.0/scanner.c:4350: relocation truncated to fit: 
R_SPARC_GOT13 .LC1

scanner.o(.text+0x6c0): In function `pcap__scan_bytes':
/home/libpcap-1.3.0/scanner.c:4413: relocation truncated to fit: 
R_SPARC_GOT13 .LC3
scanner.o(.text+0x6e0):/home/libpcap-1.3.0/scanner.c:4404: relocation 
truncated to fit: R_SPARC_GOT13 .LC2

scanner.o(.text+0x758): In function `lex_init':
./scanner.l:399: additional relocation overflows omitted from the output
collect2: ld returned 1 exit status
*** Error code 1


Would anyone be able to give me a hand to build it into my system?


Regards,


Kaya
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers


Re: [tcpdump-workers] Libpcap 1.3.0 not building on OpenBSD 5.2 sparc64

2012-12-10 Thread Kaya Saman

On 12/10/2012 07:58 PM, Guy Harris wrote:

On Dec 10, 2012, at 9:50 AM, Kaya Saman  wrote:


I'm trying to build libpcap 1.3.0 on my Sun Fire V210 running OpenBSD 5.2 
however, I keep getting errors??

The configuration script doesn't come up with anything claiming to be an error

That's because there isn't anything on the system that would inherently prevent 
it from building.


however, if I run 'make' afterwards I get this:

# make
VER=`cat ./VERSION`;  MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' ./VERSION`;  
gcc -shared -Wl,-soname,libpcap.so.$MAJOR_VER   -o libpcap.so.$VER pcap-bpf.o 
fad-getad.o pcap.o inet.o gencode.o optimize.o nametoaddr.o etherent.o 
savefile.o sf-pcap.o sf-pcap-ng.o pcap-common.o bpf_image.o bpf_dump.o  
scanner.o grammar.o bpf_filter.o version.o
scanner.o(.text+0x3b8): In function `pcap__load_buffer_state':
/home/libpcap-1.3.0/scanner.c:4207: relocation truncated to fit: R_SPARC_GOT13 
yy_n_chars

That's probably because it needs to be compiled with -fPIC rather than -fpic - 
offsets in SPARC instructions are, I think, shorter than in at least some other 
instruction sets, so if the global offset table is too large (which it 
apparently is, perhaps due to the Flex-generated scanner, given that the 
complaints from the linker are about it), the compiler might need to generate 
instructions that synthesize larger offsets than will fit in the 13-bit offset 
field.


Would anyone be able to give me a hand to build it into my system?

Edit the Makefile and replace all occurrences of "-fpic" with "-fPIC", do "make clean", 
and then try doing "make" again.  I'll fix the configure script by adding OpenBSD to the list of platforms 
where 64-bit SPARC requires -fPIC.


Many thanks Guy,

this worked fine :-)

I just hope it's installed properly; though the installation of Snort 
and Daq went perfectly so will just need to test more.



Regards,


Kaya
___
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers