Changeset 343d0da1 in mainline


Ignore:
Timestamp:
2011-06-26T01:33:53Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
10fdd0e
Parents:
c3b653a
Message:

Libiberty fnmatch prevented from shadowing libposix fnmatch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/binutils/intrusive.sh

    rc3b653a r343d0da1  
    8585# from libposix are prefixed with the posix_ prefix.
    8686#
     87# Patch 7
     88# Implementation of fnmatch inside libiberty is not very friendly to the
     89# non-GNU libc which implements its own native fnmatch. To resolve this
     90# incompatibility, libiberty fnmatch has to be manually hidden.
     91#
    8792
    8893case "$1" in
     
    95100                cp -f "$2/ld/configure" "$2/ld/configure.backup"
    96101                cp -f "$2/libiberty/configure" "$2/libiberty/configure.backup"
     102                cp -f "$2/libiberty/Makefile.in" "$2/libiberty/Makefile.in.backup"
     103                cp -f "$2/include/fnmatch.h" "$2/include/fnmatch.h.backup"
     104                cp -f "$2/libiberty/fnmatch.c" "$2/libiberty/fnmatch.c.backup"
    97105                cp -f "$2/libiberty/pex-common.h" "$2/libiberty/pex-common.h.backup"
    98106                cp -f "$2/libiberty/xstrerror.c" "$2/libiberty/xstrerror.c.backup"
     
    139147                sed 's/^cross_compiling=no/cross_compiling=yes/g' \
    140148                > "$2/libiberty/configure"
     149
     150                # Hide libiberty fnmatch implementation.
     151                # See Patch 7.
     152                mv -f "$2/include/fnmatch.h" "$2/include/fnmatch_hide.h"
     153                (
     154                # Avoid compiler warning for empty compilation unit.
     155                echo 'char __fnmatch_hide(void);'
     156                echo 'char __fnmatch_hide(void) { return 0; }'
     157                echo '#define __GNU_LIBRARY__'
     158                cat "$2/libiberty/fnmatch.c.backup"
     159                ) > "$2/libiberty/fnmatch.c"
     160                mv -f "$2/libiberty/fnmatch.c" "$2/libiberty/fnmatch_hide.c"
     161                cat "$2/libiberty/Makefile.in.backup" | \
     162                sed 's/fnmatch/fnmatch_hide/g' \
     163                > "$2/libiberty/Makefile.in"
    141164
    142165                # Patch libiberty pex-common.h.
     
    170193                mv -f "$2/ld/configure.backup" "$2/ld/configure"
    171194                mv -f "$2/libiberty/configure.backup" "$2/libiberty/configure"
     195                mv -f "$2/libiberty/Makefile.in.backup" "$2/libiberty/Makefile.in"
     196                rm -f "$2/include/fnmatch_hide.h" "$2/libiberty/fnmatch_hide.c"
     197                mv -f "$2/include/fnmatch.h.backup" "$2/include/fnmatch.h"
     198                mv -f "$2/libiberty/fnmatch.c.backup" "$2/libiberty/fnmatch.c"
    172199                mv -f "$2/libiberty/pex-common.h.backup" "$2/libiberty/pex-common.h"
    173200                mv -f "$2/libiberty/xstrerror.c.backup" "$2/libiberty/xstrerror.c"
Note: See TracChangeset for help on using the changeset viewer.