BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001959 [buildroot] Architecture Specific minor always 01-21-08 11:46 01-23-08 12:08
Reporter dajhorn View Status public  
Assigned To buildroot
Priority normal Resolution open  
Status assigned   Product Version 0.9.27
Summary 0001959: mDNSResponder-107.6 fails to cross compile with incompatible object error
Description The mDNSResponder 107.6 package fails to cross compile in buildroot revision 20883 with this error:

cc dns-sd.c -L../mDNSPosix/build/prod/ -ldns_sd -I../mDNSShared -o build/dns-sd
/usr/bin/ld: skipping incompatible ../mDNSPosix/build/prod//libdns_sd.so when searching for -ldns_sd
/usr/bin/ld: cannot find -ldns_sd
collect2: ld returned 1 exit status

This package compiles properly when the buildroot host is the same architecture as the buildroot target.
Additional Information A transcript for building the mDNSResponder 107.6 package on an amd64 host for an i386 target is attached.
Attached Files  mDNSResponder-build_amd64.txt [^] (8,495 bytes) 01-21-08 11:46
 mDNSResponder-build_i386.txt [^] (112,354 bytes) 01-21-08 11:47
 buildroot-bug0001959.patch [^] (1,999 bytes) 01-23-08 12:08

- Relationships

- Notes
(0003479)
dajhorn
01-21-08 11:47

The second attachment is a transcript for a successful native build with the same buildroot configuration.
 
(0003484)
UlfSamuelsson
01-21-08 13:51

Is it a big surprise that calling the *native* cc compiler
to link with a cross compiled library fails?
Suggest you find the place where "cc" is called and change
that to use the cross compiler and then submit a patch.
 
(0003489)
antezedens
01-22-08 03:41
edited on: 01-22-08 03:43

I have identified 3 problems with cross-compiling mDNSResponder:
First, the STRIP make Variable is not properly set:

/build_080121/package/mdnsresponder/mdnsresponder.mk
31c31
< $(MAKE1) CC=$(TARGET_CC) os="linux" LD="$(TARGET_CC) -shared" STRIP=$(TARGET_STRIP) LOCALBASE="/usr" -C $(MDNSRESPONDER_DIR)/mDNSPosix
---
> $(MAKE1) CC=$(TARGET_CC) os="linux" LD="$(TARGET_CC) -shared" LOCALBASE="/usr" -C $(MDNSRESPONDER_DIR)/mDNSPosix

Second, the wrong ld version and the wrong strip is used:
/build_powerpc/mDNSResponder-107.6/mDNSPosix/Makefile
271c271
< LD = @ld -shared
---
> LD = ld -shared
296,297c296
< STRIP = @strip -S
---
> STRIP = strip -S


Third, the wrong CC is used:
build_powerpc/mDNSResponder-107.6/Clients/Makefile
69c69
< $(CC) $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -o $@
---
> cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -o $@

After applying these changes the package builds without a problem!

 
(0003494)
dajhorn
01-23-08 12:08

The patch by antezedens works for me. (Thanks.)

Attached is the buildroot svn diff for the change.
 

- Issue History
Date Modified Username Field Change
01-21-08 11:46 dajhorn New Issue
01-21-08 11:46 dajhorn Status new => assigned
01-21-08 11:46 dajhorn Assigned To  => buildroot
01-21-08 11:46 dajhorn File Added: mDNSResponder-build_amd64.txt
01-21-08 11:47 dajhorn Note Added: 0003479
01-21-08 11:47 dajhorn File Added: mDNSResponder-build_i386.txt
01-21-08 13:51 UlfSamuelsson Note Added: 0003484
01-22-08 03:41 antezedens Note Added: 0003489
01-22-08 03:43 antezedens Note Edited: 0003489
01-23-08 12:08 dajhorn Note Added: 0003494
01-23-08 12:08 dajhorn File Added: buildroot-bug0001959.patch


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker