This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: basic question about target binaries


> I want to make a target root filesystem.  I will compile my own
> /linuxrc file from C using the cross-compiler, but I want to make it
> dynamically linked to the glibc library.
> 
> Are the target glibc libraries generated by crosstool, or do I have to
> use the --builduserland flag?  I don't want to use ptx, I want to put
> the root system together myself.
> 
> If crosstool has already made the target libraries for me, where under
> this "gcc-4.1-20050716-glibc-2.3.2" directory can I find them?

I've also got my own custom system to build the target's filesystem.
The way I do it, is define a list of files I want, and then find where
they are by invoking   gcc -print-file-name=libc.so

In particular, here's a Makefile excerpt:

GCCLIBDIR := $(patsubst %/libc.so,%,$(shell $(CROSS_COMPILER_PREFIX)gcc -print-file-name=libc.so))
libc: $(STAGING_DIR)/lib
        @echo "Populating C runtime library files..."
        @cd $(GCCLIBDIR)/.. ; echo "$(strip $(libc_FILES))" | tr " " "\n" | \
            cpio -pu --sparse --quiet $(CANON_STAGING_DIR)

where STAGING_DIR is a (possibly relative) path to the root of the
staging area for the target's filesystem, CANON_STAGING_DIR is the same,
but a fully qualified path, and libc_FILES the list of files I want to
copy into the target filesystem, e.g. "lib/libc.so lib/libc.so.6
lib/libc-2.3.2.so lib/ld-linux.so.2 lib/ld-2.3.2.so ..."


That way, whatever toolchain I build with, the Makefile grabs that
toolchain's libraries automatically when it goes to build the target
filesystem.  So what I built with is always what I run with.


                            -----Carl

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]