実行時に以下のエラーが発生しますmake tooldir=/usr
../../binutils-2.22/libiberty/regex.c:130:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
../../binutils-2.22/libiberty/regex.c:130:7: warning: conflicting types for built-in function 'malloc' [enabled by default]
../../binutils-2.22/libiberty/regex.c:131:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
../../binutils-2.22/libiberty/regex.c:131:7: warning: conflicting types for built-in function 'realloc' [enabled by default]
In file included from /usr/include/bits/string2.h:1296:0,
from /usr/include/string.h:633,
from ../../binutils-2.22/libiberty/regex.c:149:
/usr/include/stdlib.h:470:14: error: conflicting types for 'malloc'
../../binutils-2.22/libiberty/regex.c:130:7: note: previous declaration of 'malloc' was here
In file included from ../../binutils-2.22/libiberty/regex.c:638:0:
../../binutils-2.22/libiberty/regex.c: In function 'byte_regex_compile':
../../binutils-2.22/libiberty/regex.c:2439:7: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]
../../binutils-2.22/libiberty/regex.c:2439:33: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:2500:17: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:2533:36: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:2640:28: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:3643:26: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c:4150:5: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'byte_re_compile_fastmap':
../../binutils-2.22/libiberty/regex.c:4835:11: warning: implicit declaration of function 'abort' [-Wimplicit-function-declaration]
../../binutils-2.22/libiberty/regex.c:4835:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'byte_re_match_2_internal':
../../binutils-2.22/libiberty/regex.c:7424:11: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregcomp':
../../binutils-2.22/libiberty/regex.c:7978:4: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregexec':
../../binutils-2.22/libiberty/regex.c:8053:7: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregerror':
../../binutils-2.22/libiberty/regex.c:8081:5: warning: incompatible implicit declaration of built-in function 'abort' [enabled by default]
../../binutils-2.22/libiberty/regex.c: In function 'xregfree':
../../binutils-2.22/libiberty/regex.c:8114:3: warning: incompatible implicit declaration of built-in function 'free' [enabled by default]
make[2]: *** [regex.o] Error 1
make[2]: Leaving directory `/sources/binutils-build/libiberty'
make[1]: *** [all-libiberty] Error 2
make[1]: Leaving directory `/sources/binutils-build'
make: *** [all] Error 2
誰が私を助けることができますか?
編集する:
/usr/include/stdlib.h
(ライン 470)
extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
binutils-2.22/libiberty/regex.c
(130行)
char *malloc ();
答え1
問題は、コードをコンパイルするときにSTDC_HEADERSが定義されていないことです。 47行目を参照そのバージョンの regex.c。これは実行していないconfigure
か、実行したが問題が発生したために発生する可能性があります。
まだ設定を実行していない場合は、引き続き実行してください。
./configure
これを実行すると、マクロを特定の値として定義するconfig.h
ために使用されるというファイルが生成されます。それ以外の場合は、使用しているコンパイラに依存するエントリ(システムヘッダファイルなど)が見つからないか、誤って設定されているか、正しくインストールされていない可能性があります。#define
STDC_HEADERS
上記のコメントで述べたように、使用しているbinutilsのバージョンは次のとおりです。今4歳以上です。最新バージョンを使用する必要があると思います。