1 diff -urN uClibc-0.9.29.org/extra/gcc-uClibc/gcc-uClibc.c uClibc-0.9.29/extra/gcc-uClibc/gcc-uClibc.c
2 --- uClibc-0.9.29.org/extra/gcc-uClibc/gcc-uClibc.c 1970-01-01 01:00:00.000000000 +0100
3 +++ uClibc-0.9.29/extra/gcc-uClibc/gcc-uClibc.c 2007-06-03 22:10:49.372320596 +0200
5 +/* vi: set sw=4 ts=4: */
7 + * Copyright (C) 2000 Manuel Novoa III
8 + * Copyright (C) 2002-2003 Erik Andersen
10 + * This is a crude wrapper to use uClibc with gcc.
11 + * It was originally written to work around ./configure for ext2fs-utils.
12 + * It certainly can be improved, but it works for me in the normal cases.
16 + * A bug was fixed in building the gcc command line when dynamic linking.
17 + * The functions dlopen, etc. now work. At this time, you must make sure
18 + * the correct libdl.so is included however. It is safest to, for example,
19 + * add /lib/libdl.so.1 if using ld-linux.so.1 rather than adding -ldl to the
22 + * Note: This is only a problem if devel and target archs are the same. To
23 + * avoid the problem, you can use a customized dynamic linker.
28 + * The wrapper now works with either installed and uninstalled uClibc versions.
29 + * If you want to use the uninstalled header files and libs, either include
30 + * the string "build" in the invocation name such as
31 + * 'ln -s <ARCH>-uclibc-gcc <ARCH>-uclibc-gcc-build'
32 + * or include it in the environment variable setting of UCLIBC_ENV.
33 + * Note: This automatically enables the "rpath" behavior described below.
35 + * The wrapper will now pass the location of the uClibc shared libs used to
36 + * the linker with the "-rpath" option if the invocation name includes the
37 + * string "rpath" or if the environment variable UCLIBC_ENV include it (as
38 + * with "build" above). This is primarily intended to be used on devel
39 + * platforms of the same arch as the target. A good place to use this feature
40 + * would be in the uClibc/test directory.
42 + * The wrapper now displays the command line passed to gcc when '-v' is used.
46 + * "rpath" and "build" behavior are now decoupled. You can of course get
47 + * the old "build" behavior by setting UCLIBC_ENV="rpath-build". Order
48 + * isn't important here, as only the substrings are searched for.
50 + * Added environment variable check for UCLIBC_GCC_DLOPT to let user specify
51 + * an alternative dynamic linker at runtime without using command line args.
52 + * Since this wouldn't commonly be used, I made it easy on myself. You have
53 + * to match the option you would have passed to the gcc wrapper. As an
56 + * export UCLIBC_GCC_DLOPT="-Wl,--dynamic-linker,/lib/ld-alt-linker.so.3"
58 + * This is really only useful if target arch == devel arch and DEVEL_PREFIX
59 + * isn't empty. It involves a recompile, but you can at least test apps
60 + * on your devel system if combined with the "rpath" behavor if by using
61 + * LD_LIBRARY_PATH, etc.
63 + * Also added check for "-Wl,--dynamic-linker" on the command line. The
64 + * use default dynamic linker or the envirnment-specified dynamic linker
65 + * is disabled in that case.
67 + * Added options --uclibc-use-build-dir and --uclibc-use-rpath so that those
68 + * behaviors can be invoked from the command line.
75 + * Check/modify gcc-specific environment variables?
84 +#include <sys/stat.h>
85 +#include <sys/wait.h>
87 +#include "gcc-uClibc.h"
89 +static char *our_usr_lib_path = "-L"UCLIBC_DEVEL_PREFIX"/lib";
91 +static char static_linking[] = "-static";
92 +static char nostdinc[] = "-nostdinc";
93 +static char nostartfiles[] = "-nostartfiles";
94 +static char nodefaultlibs[] = "-nodefaultlibs";
95 +static char nostdlib[] = "-nostdlib";
96 +#ifdef __UCLIBC_CTOR_DTOR__
97 +static char nostdinc_plus[] = "-nostdinc++";
100 +/* Include a local implementation of basename, since this
101 + * uses the host system's C lib, and CYGWIN apparently
102 + * doesn't provide an implementation of basename(). */
103 +char *basename(const char *path)
105 + register const char *s;
106 + register const char *p;
116 +char *dirname(char *path)
118 + static const char null_or_empty_or_noslash[] = ".";
120 + register char *last;
128 + while (*s && (*s != '/')) ++s;
130 + while (*s == '/') ++s;
136 + if (last == path) {
137 + if (*last != '/') {
140 + if ((*++last == '/') && (last[1] == 0)) {
148 + return (char *) null_or_empty_or_noslash;
152 +extern void *xmalloc(size_t size)
154 + void *ptr = malloc(size);
157 + fprintf(stderr, "memory exhausted");
158 + exit(EXIT_FAILURE);
163 +void xstrcat(char **string, ...)
167 + /* Don't bother to calculate how big exerything
168 + * will be, just be careful to not overflow... */
169 + va_start(p, string);
170 + *string = xmalloc(BUFSIZ);
173 + if (!(c = va_arg(p, const char *)))
175 + strcat(*string, c);
180 +int main(int argc, char **argv)
182 + int use_build_dir = 0, linking = 1, use_static_linking = 0;
183 + int use_stdinc = 1, use_start = 1, use_stdlib = 1, use_pic = 0;
184 + int source_count = 0, use_rpath = 0, verbose = 0;
185 + int i, j, k, l, m, n;
187 + char ** gcc_argument;
196 + char *build_dlstr = 0;
199 + char *rpath_link[2];
201 + char *uClibc_inc[2];
202 + char *our_lib_path[2];
203 + char *crt0_path[2];
204 + char *crtbegin_path[2];
205 + char *crtend_path[2];
206 + const char *application_name;
207 +#ifdef __UCLIBC_CTOR_DTOR__
208 + char *crti_path[2];
209 + char *crtn_path[2];
211 + int ctor_dtor = 1, cplusplus = 0, use_nostdinc_plus = 0;
212 + int findlibgcc = 1;
215 +#ifdef __UCLIBC_PROFILING__
217 + char *gcrt1_path[2];
220 + cc = getenv("UCLIBC_CC");
223 +#ifdef __UCLIBC_CTOR_DTOR__
228 + application_name = basename(argv[0]);
229 + if (application_name[0] == '-')
230 + application_name++;
232 +#ifdef __UCLIBC_CTOR_DTOR__
233 + /* We must use strstr since g++ might be named like a
234 + * cross compiler (i.e. arm-linux-g++). We must also
235 + * search carefully, in case we are searching something
236 + * like /opt/c++/gcc-3.1/bin/arm-linux-g++ or some similar
238 + len = strlen(application_name);
239 + if ((strcmp(application_name+len-3, "g++")==0) ||
240 + (strcmp(application_name+len-3, "c++")==0)) {
242 + if (strcmp(cc+len-3, "gcc")==0) {
248 + use_nostdinc_plus = 1;
252 + devprefix = getenv("UCLIBC_DEVEL_PREFIX");
254 + devprefix = UCLIBC_DEVEL_PREFIX;
257 + runprefix = getenv("UCLIBC_RUNTIME_PREFIX");
259 + runprefix = UCLIBC_RUNTIME_PREFIX;
262 + builddir = getenv("UCLIBC_BUILD_DIR");
264 + builddir = UCLIBC_BUILD_DIR;
267 + incstr = getenv("UCLIBC_GCC_INC");
268 + libstr = getenv("UCLIBC_GCC_LIB");
270 + ep = getenv("UCLIBC_ENV");
275 + if (strstr(ep,"build") != 0) {
279 + if (strstr(ep,"rpath") != 0) {
284 + xstrcat(&(rpath_link[0]), "-Wl,-rpath-link,", devprefix, "/lib:", runprefix, "/lib", NULL);
285 + xstrcat(&(rpath_link[1]), "-Wl,-rpath-link,", builddir, "/lib", NULL);
287 + xstrcat(&(rpath[0]), "-Wl,-rpath,", devprefix, "/lib:", runprefix, "/lib", NULL);
288 + xstrcat(&(rpath[1]), "-Wl,-rpath,", builddir, "/lib", NULL);
290 + xstrcat(&(uClibc_inc[0]), devprefix, "/include/", NULL);
291 + xstrcat(&(uClibc_inc[1]), builddir, "/include/", NULL);
293 +#ifdef __UCLIBC_CTOR_DTOR__
294 + xstrcat(&(crt0_path[0]), devprefix, "/lib/crt1.o", NULL);
295 + xstrcat(&(crt0_path[1]), builddir, "/lib/crt1.o", NULL);
296 + xstrcat(&(crti_path[0]), devprefix, "/lib/crti.o", NULL);
297 + xstrcat(&(crti_path[1]), builddir, "/lib/crti.o", NULL);
298 + xstrcat(&(crtn_path[0]), devprefix, "/lib/crtn.o", NULL);
299 + xstrcat(&(crtn_path[1]), builddir, "/lib/crtn.o", NULL);
301 + xstrcat(&(crt0_path[0]), devprefix, "/lib/crt0.o", NULL);
302 + xstrcat(&(crt0_path[1]), builddir, "/lib/crt0.o", NULL);
304 +#ifdef __UCLIBC_PROFILING__
305 + xstrcat(&(gcrt1_path[0]), devprefix, "/lib/gcrt1.o", NULL);
306 + xstrcat(&(gcrt1_path[1]), builddir, "/lib/gcrt1.o", NULL);
309 + xstrcat(&(our_lib_path[0]), "-L", devprefix, "/lib", NULL);
310 + xstrcat(&(our_lib_path[1]), "-L", builddir, "/lib", NULL);
312 +#ifdef __UCLIBC_HAS_SHARED__
313 + build_dlstr = "-Wl,--dynamic-linker," BUILD_DYNAMIC_LINKER;
314 + dlstr = getenv("UCLIBC_GCC_DLOPT");
316 + dlstr = "-Wl,--dynamic-linker," DYNAMIC_LINKER;
321 + libraries = __builtin_alloca(sizeof(char*) * (argc));
322 + libraries[m] = '\0';
325 + libpath = __builtin_alloca(sizeof(char*) * (argc));
328 + for ( i = 1 ; i < argc ; i++ ) {
329 + if (argv[i][0] == '-') { /* option */
330 + switch (argv[i][1]) {
331 + case 'c': /* compile or assemble */
332 + case 'S': /* generate assembler code */
333 + case 'E': /* preprocess only */
334 + case 'M': /* generate dependencies */
337 + case 'L': /* library */
338 + libpath[n++] = argv[i];
340 + if (argv[i][2] == 0) {
342 + libpath[n++] = argv[++i];
347 + case 'l': /* library */
348 + libraries[m++] = argv[i];
349 + libraries[m] = '\0';
352 + case 'v': /* verbose */
353 + if (argv[i][2] == 0) verbose = 1;
354 + printf("Invoked as %s\n", argv[0]);
357 + if (strcmp(nostdinc,argv[i]) == 0) {
359 + } else if (strcmp(nostartfiles,argv[i]) == 0) {
360 +#ifdef __UCLIBC_CTOR_DTOR__
364 + } else if (strcmp(nodefaultlibs,argv[i]) == 0) {
367 + } else if (strcmp(nostdlib,argv[i]) == 0) {
368 +#ifdef __UCLIBC_CTOR_DTOR__
374 +#ifdef __UCLIBC_CTOR_DTOR__
375 + else if (strcmp(nostdinc_plus,argv[i]) == 0) {
376 + if (cplusplus==1) {
377 + use_nostdinc_plus = 0;
383 + if (strstr(argv[i],static_linking) != NULL) {
384 + use_static_linking = 1;
386 + if (strcmp("-shared",argv[i]) == 0) {
391 + case 'W': /* -static could be passed directly to ld */
392 + if (strncmp("-Wl,",argv[i],4) == 0) {
393 + if (strstr(argv[i],static_linking) != 0) {
394 + use_static_linking = 1;
396 + if (strstr(argv[i],"--dynamic-linker") != 0) {
399 + if ((strstr(argv[i],"-z,combreloc") != 0) ||
400 + (strstr(argv[i],"-z,relro") != 0)) {
405 +#ifdef __UCLIBC_PROFILING__
407 + if (strcmp("-pg",argv[i]) == 0) {
413 + /* Check if we are doing PIC */
414 + if (strcmp("-fPIC",argv[i]) == 0) {
416 + } else if (strcmp("-fpic",argv[i]) == 0) {
419 +#ifdef __UCLIBC_PROFILING__
420 + else if (strcmp("-fprofile-arcs",argv[i]) == 0) {
427 + if (strstr(argv[i]+1,static_linking) != NULL) {
428 + use_static_linking = 1;
430 + } else if (strcmp("--uclibc-use-build-dir",argv[i]) == 0) {
433 + } else if (strcmp("--uclibc-use-rpath",argv[i]) == 0) {
436 + } else if (strcmp ("--uclibc-cc", argv[i]) == 0 && argv[i + 1]) {
440 + } else if (strncmp ("--uclibc-cc=", argv[i], 12) == 0) {
444 +#ifdef __UCLIBC_CTOR_DTOR__
445 + else if (strcmp("--uclibc-no-ctors",argv[i]) == 0) {
452 + } else { /* assume it is an existing source file */
457 + gcc_argv = __builtin_alloca(sizeof(char*) * (argc + 64));
458 + gcc_argument = __builtin_alloca(sizeof(char*) * (argc + 20));
461 +#ifdef __UCLIBC_CTOR_DTOR__
463 + struct stat statbuf;
464 + if (findlibgcc==1 || stat(LIBGCC_DIR, &statbuf)!=0 ||
465 + !S_ISDIR(statbuf.st_mode))
467 + /* Bummer, gcc is hiding from us. This is going
468 + * to really slow things down... bummer. */
469 + int status, gcc_pipe[2];
473 + if (!(pid = fork())) {
475 + close(gcc_pipe[0]);
478 + dup2(gcc_pipe[1], 1);
479 + dup2(gcc_pipe[1], 2);
481 + argv[1] = "-print-libgcc-file-name";
484 + close(gcc_pipe[1]);
485 + _exit(EXIT_FAILURE);
488 + while (wpid != pid) {
489 + wpid = wait(&status);
491 + close(gcc_pipe[1]);
492 + if (WIFEXITED(status) && WEXITSTATUS(status)) {
494 + fprintf(stderr, "Unable to locale crtbegin.o provided by gcc");
495 + exit(EXIT_FAILURE);
497 + if (WIFSIGNALED(status)) {
498 + fprintf(stderr, "%s exited because of uncaught signal %d", cc, WTERMSIG(status));
499 + exit(EXIT_FAILURE);
503 + char buf[1024], *dir;
504 + status = read(gcc_pipe[0], buf, sizeof(buf));
505 + close(gcc_pipe[0]);
509 + buf[(status == sizeof(buf)) ? status-1 : status] = 0;
510 + dir = dirname(buf);
511 + xstrcat(&(crtbegin_path[0]), dir, "/crtbegin.o", NULL);
512 + xstrcat(&(crtbegin_path[1]), dir, "/crtbeginS.o", NULL);
513 + xstrcat(&(crtend_path[0]), dir, "/crtend.o", NULL);
514 + xstrcat(&(crtend_path[1]), dir, "/crtendS.o", NULL);
518 + xstrcat(&(crtbegin_path[0]), LIBGCC_DIR, "crtbegin.o", NULL);
519 + xstrcat(&(crtbegin_path[1]), LIBGCC_DIR, "crtbeginS.o", NULL);
520 + xstrcat(&(crtend_path[0]), LIBGCC_DIR, "crtend.o", NULL);
521 + xstrcat(&(crtend_path[1]), LIBGCC_DIR, "crtendS.o", NULL);
525 + if (cplusplus && cpp)
526 + gcc_argv[i++] = cpp;
529 + gcc_argv[i++] = cc;
531 + for ( j = 1 ; j < argc ; j++ ) {
532 + if (argv[j]=='\0') {
535 + gcc_argument[k++] = argv[j];
536 + gcc_argument[k] = '\0';
540 + if (linking && source_count) {
541 + gcc_argv[i++] = "-Wl,--hash-style=gnu";
542 +#if defined __HAVE_ELF__ && ! defined __UCLIBC_HAS_MMU__
543 + gcc_argv[i++] = "-Wl,-elf2flt";
545 + gcc_argv[i++] = nostdlib;
546 + if (use_static_linking) {
547 + gcc_argv[i++] = static_linking;
549 + if (!use_static_linking) {
550 + if (dlstr && use_build_dir) {
551 + gcc_argv[i++] = build_dlstr;
552 + } else if (dlstr) {
553 + gcc_argv[i++] = dlstr;
556 + gcc_argv[i++] = rpath[use_build_dir];
559 + for ( l = 0 ; l < n ; l++ ) {
560 + if (libpath[l]) gcc_argv[i++] = libpath[l];
562 + gcc_argv[i++] = rpath_link[use_build_dir]; /* just to be safe */
564 + gcc_argv[i++] = libstr;
565 + gcc_argv[i++] = our_lib_path[use_build_dir];
566 + if (!use_build_dir) {
567 + gcc_argv[i++] = our_usr_lib_path;
570 + if (use_stdinc && source_count) {
571 + gcc_argv[i++] = nostdinc;
572 +#ifdef __UCLIBC_CTOR_DTOR__
575 + if (use_nostdinc_plus) {
576 + gcc_argv[i++] = nostdinc_plus;
578 + xstrcat(&cppinc, uClibc_inc[use_build_dir], "g++/", NULL);
579 + gcc_argv[i++] = "-isystem";
580 + gcc_argv[i++] = cppinc;
581 + xstrcat(&cppinc, uClibc_inc[use_build_dir], "g++-v3/", NULL);
582 + gcc_argv[i++] = "-isystem";
583 + gcc_argv[i++] = cppinc;
586 + gcc_argv[i++] = "-isystem";
587 + gcc_argv[i++] = uClibc_inc[use_build_dir];
588 + gcc_argv[i++] = "-iwithprefix";
589 + gcc_argv[i++] = "include";
591 + gcc_argv[i++] = incstr;
594 + if (linking && source_count) {
596 +#ifdef __UCLIBC_PROFILING__
598 + gcc_argv[i++] = gcrt1_path[use_build_dir];
601 +#ifdef __UCLIBC_CTOR_DTOR__
603 + gcc_argv[i++] = crti_path[use_build_dir];
605 + gcc_argv[i++] = crtbegin_path[1];
607 + gcc_argv[i++] = crtbegin_path[0];
612 +#ifdef __UCLIBC_PROFILING__
616 + gcc_argv[i++] = crt0_path[use_build_dir];
619 + for ( l = 0 ; l < k ; l++ ) {
620 + if (gcc_argument[l]) gcc_argv[i++] = gcc_argument[l];
623 + //gcc_argv[i++] = "-Wl,--start-group";
624 + gcc_argv[i++] = "-lgcc";
626 + for ( l = 0 ; l < m ; l++ ) {
627 + if (libraries[l]) gcc_argv[i++] = libraries[l];
630 +#ifdef __UCLIBC_CTOR_DTOR__
632 + gcc_argv[ i++ ] = "-lstdc++";
633 + gcc_argv[ i++ ] = "-lm";
636 + gcc_argv[i++] = "-lc";
637 + gcc_argv[i++] = "-lgcc";
638 + //gcc_argv[i++] = "-Wl,--end-group";
640 +#ifdef __UCLIBC_CTOR_DTOR__
643 + gcc_argv[i++] = crtend_path[1];
645 + gcc_argv[i++] = crtend_path[0];
648 + gcc_argv[i++] = crtn_path[use_build_dir];
652 + for ( l = 0 ; l < k ; l++ ) {
653 + if (gcc_argument[l]) gcc_argv[i++] = gcc_argument[l];
656 + gcc_argv[i++] = NULL;
659 + for ( j = 0 ; gcc_argv[j] ; j++ ) {
660 + printf("arg[%2i] = %s\n", j, gcc_argv[j]);
664 + //no need to free memory from xstrcat because we never return...
665 +#ifdef __UCLIBC_CTOR_DTOR__
666 + if (cplusplus && cpp) {
667 + execvp(cpp, gcc_argv);
668 + fprintf(stderr, "%s: %s\n", cpp, strerror(errno));
672 + execvp(cc, gcc_argv);
673 + fprintf(stderr, "%s: %s\n", cc, strerror(errno));
675 + exit(EXIT_FAILURE);
677 diff -urN uClibc-0.9.29.org/extra/gcc-uClibc/Makefile uClibc-0.9.29/extra/gcc-uClibc/Makefile
678 --- uClibc-0.9.29.org/extra/gcc-uClibc/Makefile 1970-01-01 01:00:00.000000000 +0100
679 +++ uClibc-0.9.29/extra/gcc-uClibc/Makefile 2007-06-03 22:10:14.593807939 +0200
681 +# Makefile for building a fake gcc/binutils toolchain
682 +# that simply spoofs the location of the C library
684 +# Copyright (C) 2000-2002 Erik Andersen <andersen@uclibc.org>
688 +include $(TOPDIR)Rules.mak
689 +include $(TOPDIR)/.config
691 +UCLIBC_DIR = $(shell (cd ../.. ; /bin/pwd))
692 +GCC_BIN = $(shell which $(CC))
693 +LD_BIN = $(shell which $(LD))
694 +GCCINCDIR:= ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
696 +all: gcc-uClibc ld-uClibc
698 +gcc-uClibc.h: Makefile $(TOPDIR)/.config
699 + @echo "/* this file was autogenerated by make */" > gcc-uClibc.h
700 + @echo "#define UCLIBC_TARGET_PREFIX " \"$(TARGET_PREFIX)\" >> gcc-uClibc.h
701 + @echo "#define UCLIBC_DEVEL_PREFIX " \"$(DEVEL_PREFIX)\" >> gcc-uClibc.h
702 + @echo "#define UCLIBC_RUNTIME_PREFIX " \"$(RUNTIME_PREFIX)\" >> gcc-uClibc.h
703 + @echo "#define UCLIBC_BUILD_DIR " \"$(UCLIBC_DIR)\" >> gcc-uClibc.h
704 + @echo "#define GCC_BIN " \"$(GCC_BIN)\" >> gcc-uClibc.h
705 + @echo "#define LIBGCC_DIR " \"$(LIBGCC_DIR)\" >> gcc-uClibc.h
706 + @echo "#define TARGET_ARCH " \"$(TARGET_ARCH)\" >> gcc-uClibc.h
707 + @echo "#define DYNAMIC_LINKER " \"$(RUNTIME_PREFIX)/lib/$(UCLIBC_LDSO)\" >> gcc-uClibc.h
708 + @echo "#define BUILD_DYNAMIC_LINKER " \"$(UCLIBC_DIR)/lib/$(UCLIBC_LDSO)\" >> gcc-uClibc.h
709 +ifeq ($(strip $(HAVE_SHARED)),y)
710 + @echo "#define __UCLIBC_HAS_SHARED__ 1" >> gcc-uClibc.h
712 + @echo "#undef __UCLIBC_HAS_SHARED__" >> gcc-uClibc.h
714 +ifeq ($(strip $(UCLIBC_HAS_MMU)),y)
715 + @echo "#define __UCLIBC_HAS_MMU__ 1" >> gcc-uClibc.h
717 + @echo "#undef __UCLIBC_HAS_MMU__" >> gcc-uClibc.h
719 +ifeq ($(strip $(HAS_ELF)),y)
720 + @echo "#define __HAS_ELF__ 1" >> gcc-uClibc.h
722 + @echo "#undef __HAS_ELF__" >> gcc-uClibc.h
724 +ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
725 + @echo "#define __UCLIBC_CTOR_DTOR__ 1" >> gcc-uClibc.h
726 +ifeq ($(strip $(UCLIBC_PROFILING)),y)
727 + @echo "#define __UCLIBC_PROFILING__ 1" >> gcc-uClibc.h
729 + @echo "#undef __UCLIBC_PROFILING__" >> gcc-uClibc.h
732 + @echo "#undef __UCLIBC_CTOR_DTOR__" >> gcc-uClibc.h
735 +gcc-uClibc: gcc-uClibc.h gcc-uClibc.c
736 + $(HOSTCC) $(HOSTCFLAGS) -s gcc-uClibc.c -o $(TARGET_ARCH)-uclibc-gcc
740 + @echo "#!/bin/sh" > $(TARGET_ARCH)-uclibc-ld
741 + @echo "# This file was autogenerated by make" >> $(TARGET_ARCH)-uclibc-ld
742 + @echo "exec $(LD_BIN) \$$@ -L$(DEVEL_PREFIX)/lib" >> $(TARGET_ARCH)-uclibc-ld
743 + chmod a+x $(TARGET_ARCH)-uclibc-ld
747 + install -d $(PREFIX)$(DEVEL_PREFIX)/bin;
748 + install -d $(PREFIX)$(RUNTIME_PREFIX)/bin;
749 + install -m 755 $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/
750 + install -m 755 $(TARGET_ARCH)-uclibc-ld $(PREFIX)$(RUNTIME_PREFIX)/bin/
751 + ln -fs $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-cc
752 + ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/gcc
753 + ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/cc
754 + ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-ld $(PREFIX)$(DEVEL_PREFIX)/bin/ld
755 +ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
756 + ln -fs $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-g++
757 + ln -fs $(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-c++
758 + ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/c++
759 + ln -fs $(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-gcc $(PREFIX)$(DEVEL_PREFIX)/bin/g++
761 + for app in addr2line ar as cpp nm objcopy \
762 + objdump ranlib size strings strip; do \
763 + APPNAME=`which $(CROSS)$${app}`; \
764 + if [ -x "$$APPNAME" ] ; then \
765 + ln -fs "$$APPNAME" $(PREFIX)$(DEVEL_PREFIX)/bin/$${app}; \
766 + ln -fs "$$APPNAME" $(PREFIX)$(RUNTIME_PREFIX)/bin/$(TARGET_ARCH)-uclibc-$${app}; \
771 + rm -f gcc-uClibc.h *-uclibc-gcc *-uclibc-ld core
774 --- uClibc-0.9.32/Makefile.in.orig 2011-06-08 21:35:20.000000000 +0200
775 +++ uClibc-0.9.32/Makefile.in 2011-06-12 09:20:09.634046086 +0200
778 ifeq ($(HAVE_DOT_CONFIG),y)
781 +all: pregen libs toolchain
784 # In this section, we need .config
789 -install: install_runtime install_dev
790 +install: install_runtime install_dev install_toolchain
793 RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)$(MULTILIB_DIR) $(RUNTIME_PREFIX)$(MULTILIB_DIR))
796 endif # ifeq ($(HAVE_DOT_CONFIG),y)
799 + $(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C extra/gcc-uClibc
801 +install_toolchain: toolchain
802 + $(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C extra/gcc-uClibc install
805 $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils $@