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
0001612 [buildroot] Architecture Specific minor always 11-27-07 06:13 12-11-07 14:50
Reporter ikonst View Status public  
Assigned To buildroot
Priority normal Resolution open  
Status assigned   Product Version
Summary 0001612: TARGET_CONFIGURE_OPTS redefine CC with TARGET_CFLAGS but not TARGET_LDFLAGS
Description In package/Makefile.in, we have:
TARGET_CONFIGURE_OPTS= ...
               CC="$(TARGET_CROSS)gcc $(TARGET_CFLAGS)" \

So, instead of passing CFLAGS=$(TARGET_CFLAGS), we define it as part of the CC execution string, which is fine. However, we don't pass TARGET_LDFLAGS here, which is just as important -- in particular for external toolchains, where the LDFLAGS are necessary to link with $(STAGING_DIR)/lib.
Additional Information
Attached Files  target_cc_with_ldflags.patch [^] (1,297 bytes) 11-27-07 06:13

- Relationships

- Notes
(0003089)
vanokuten
12-11-07 12:26

But TARGET_LDFLAGS are passed in:
LD="$(TARGET_CROSS)ld $(TARGET_LDFLAGS)"

Do not understand why linker flags are needed on compile CC stage.
Could you please explain what particular problem are you facing with?

regards,
Ivan
 
(0003099)
ikonst
12-11-07 14:50

This is not just the CC used for compilation. Very often, package build systems elect to link with using the CC as well, e.g.:

  gcc one.o two.o three.o -L/somewhere -lfoobar -o someapp

In this case, the CC needs all linker flags. In my case, the -L linker flags were missing.

My case is an "external toolchain" case, and in this case, the -L flag is used to direct the linker (whether invoked directly as 'ld' or indirectly by the C compiler) to the libs in the staging dir.

Why do we need to specify the staging dir explicitly? Unlike a buildroot-built toolchain (an "internal" toolchain) which is precompiled to use STAGING_DIR/include and STAGING_DIR/lib as its system headers/libraries directories, an external toolchain will typically refer to its own system headers (containing only standard C library headers) and its own system libraries (containing only libc.so).
 

- Issue History
Date Modified Username Field Change
11-27-07 06:13 ikonst New Issue
11-27-07 06:13 ikonst Status new => assigned
11-27-07 06:13 ikonst Assigned To  => buildroot
11-27-07 06:13 ikonst File Added: target_cc_with_ldflags.patch
12-11-07 12:26 vanokuten Note Added: 0003089
12-11-07 14:50 ikonst Note Added: 0003099


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker