简体   繁体   English

Makefile 在通过 ./configure --host=mingw32 后制作时崩溃

[英]Makefile crashed while making after pass the ./configure --host=mingw32

Everyone: situation: MacOS with x86_64-w64-mingw32 compiling toolchain I tried to compile GDB for Windows from the source code of GDB.大家:情况:MacOS 使用 x86_64-w64-mingw32 编译工具链 我试图从 GDB 的源代码编译 GDB for Windows。 But, after ./configure, I got但是,在 ./configure 之后,我得到了

/bin/sh ./libtool  --tag=CC   --mode=link x86_64-w64-mingw32-gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Wno-format -I./../zlib -Iincludedir -D__USE_MINGW_ACCESS  -release `cat libtool-soversion`  -Llibdir -Wl,--stack,12582912 -o libbfd.la -rpath /usr/local/lib archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo `cat ofiles`   -L./../zlib -lz 
./libtool: line 5208: cd: libdir: No such file or directory
libtool: link: cannot determine absolute directory name of `libdir'
make[4]: *** [libbfd.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-bfd] Error 2

I am sure my MingW32 is fully built and capable.我确信我的 MingW32 已经完全构建并且功能强大。

x86_64-w64-mingw32-addr2line   x86_64-w64-mingw32-dllwrap     x86_64-w64-mingw32-gcc-ranlib  x86_64-w64-mingw32-ld.bfd      x86_64-w64-mingw32-size
x86_64-w64-mingw32-ar          x86_64-w64-mingw32-elfedit     x86_64-w64-mingw32-gcov        x86_64-w64-mingw32-lto-dump    x86_64-w64-mingw32-strings
x86_64-w64-mingw32-as          x86_64-w64-mingw32-g++         x86_64-w64-mingw32-gcov-dump   x86_64-w64-mingw32-nm          x86_64-w64-mingw32-strip
x86_64-w64-mingw32-c++         x86_64-w64-mingw32-gcc         x86_64-w64-mingw32-gcov-tool   x86_64-w64-mingw32-objcopy     x86_64-w64-mingw32-windmc
x86_64-w64-mingw32-c++filt     x86_64-w64-mingw32-gcc-10.2.0  x86_64-w64-mingw32-gfortran    x86_64-w64-mingw32-objdump     x86_64-w64-mingw32-windres
x86_64-w64-mingw32-cpp         x86_64-w64-mingw32-gcc-ar      x86_64-w64-mingw32-gprof       x86_64-w64-mingw32-ranlib      
x86_64-w64-mingw32-dlltool     x86_64-w64-mingw32-gcc-nm      x86_64-w64-mingw32-ld          x86_64-w64-mingw32-readelf   

I install it via HomeBrew And here is the config for libdir in my Makefile我通过 HomeBrew 安装它,这是我的 Makefile 中 libdir 的配置

prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
LDFLAGS = -Llibdir
...
    "libdir=$(libdir)" \
...

Totally have no idea how to fix this.完全不知道如何解决这个问题。 Any idea?任何的想法? Or if you need some more information to figure it out, just let me know.或者,如果您需要更多信息来弄清楚,请告诉我。

And just download the source code of GDB, I think you could duplicate the same scenario.只需下载GDB的源代码,我认为您可以复制相同的场景。

./libtool: line 5208: cd: libdir: No such file or directory
libtool: link: cannot determine absolute directory name of `libdir'
make[4]: *** [libbfd.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-bfd] Error 2
make: *** [all] Error 2

As the command line and error message say, you give libtool not the right path.正如命令行和错误消息所说,您为 libtool 提供了不正确的路径。

The command line contains -Llibdir and the error message says "cannot determine absolute directory name of 'libdir'".命令行包含-Llibdir ,错误消息显示“无法确定 'libdir' 的绝对目录名称”。

So you wrote your Makefile to use libdir literally and not as the variable as it should be.所以你写了你的 Makefile 来使用libdir而不是像它应该的那样使用变量。 Change it into:改成:

LDFLAGS = -L$(libdir)

or或者

LDFLAGS = -L${libdir}

There is no real difference between parentheses and braces, just don't mix them up.括号和大括号之间没有真正的区别,只是不要混淆它们。 Helpful links are: The difference between parentheses and curly braces in GNU Make and What's the difference between parenthesis $() and curly bracket ${} syntax in Makefile?有用的链接是: GNU Make 中括号和大括号之间的区别以及 Makefile 中括号 $() 和大括号 ${} 语法之间的区别是什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM