From f2aca6575ff7af372c3e089f266a45f6552eb368 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 8 Jan 2014 09:52:14 +0100 Subject: [PATCH] common/cross-profiles: add a script from sabotage to workaround gnulib issues with musl. --- common/cross-profiles/musl-gnulibfix | 179 +++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 common/cross-profiles/musl-gnulibfix diff --git a/common/cross-profiles/musl-gnulibfix b/common/cross-profiles/musl-gnulibfix new file mode 100644 index 00000000000..a9ff663d3a4 --- /dev/null +++ b/common/cross-profiles/musl-gnulibfix @@ -0,0 +1,179 @@ +#!/bin/sh +empty_file() { + rm -f "$1" + touch "$1" +} + +dir="$1" +# fix files breaking the build entirely +for i in fseeko.c freadahead.c fseterr.c ; do empty_file "$dir"/$i ; done +echo "void close_stdin(void) {}" > "$dir"/closein.c + +# fix stuff trying to reimplement libc +culprits=`cat << EOF +accept4 +acosl +alloca +alphasort +asinl +asprintf +atanl +atexit +atoll +bcopy +btowc +chown +closedir +cosl +dirfd +dprintf +dup2 +dup3 +_Exit +expl +fchdir +fchown-stub +fdatasync +fdopendir +ffs +flock +fnmatch +forkpty +fpending +fprintf +freeaddrinfo +fsync +ftell +ftruncate +futimens +gai_strerror +getaddrinfo +getdelim +getdtablesize +getgroups +gethostname +getline +getlogin +getlogin_r +getnameinfo +getpagesize +getpass +getsubopt +gettimeofday +getusershell +gmtime_r +grantpt +imaxabs +imaxdiv +inet_ntop +inet_pton +isblank +iswblank +lchmod +lchown +ldexp +ldexpl +link +linkat +logl +mbrlen +mbrtowc +mbsinit +memmove +mempcpy +mkdtemp +mkfifo +mkfifoat +mknod +mknodat +mkstemp +mktime +nanosleep +nl_langinfo +open +openat +opendir +openpty +pclose +perror +pipe +pipe2 +poll +popen +pread +pselect +ptsname +pwrite +raise +readdir +readlink +renameat +rewinddir +setenv +sigaction +sigaddset +sigdelset +sigemptyset +sigfillset +sigismember +sigpending +sigprocmask +sinl +snprintf +spawnattr_destroy +spawnattr_getdefault +spawnattr_getflags +spawnattr_getpgroup +spawnattr_getsigmask +spawnattr_init +spawnattr_setdefault.c +spawnattr_setflags +spawnattr_setpgroup +spawnattr_setsigmask +spawn_faction_addclose +spawn_faction_adddup2 +spawn_faction_addopen +spawn_faction_destroy +spawn_faction_init +spawn_factions_addopen +spawn_factions_destroy +spawn_factions_init +sprintf +sqrtl +stdio-read +stdio-write +strcasecmp +strcasestr +strchrnul +strcspn +strncasecmp +strndup +strnlen +strpbrk +strsep +strsignal +strstr +strtod +strtoimax +strtol +symlink +symlinkat +tanl +tcgetsid +timegm +time_r +times +tmpfile +uname +unlockpt +unsetenv +usleep +vasprintf +vdprintf +waitpid +wcrtomb +wctob +EOF +` +#fixme check fsusage +for i in $culprits ; do empty_file "$dir"/$i.c ; done