尝试在WSL中安装glibc时出错:针对未定义的符号'__GI___open64_nocancel'重定位R_X86_64_PC32

时间:2019-03-26 11:19:04

标签: c gcc gnu-make glibc windows-subsystem-for-linux

当尝试将最新的glibc安装到我的计算机中时,只要我执行带有标志的“ config”可执行文件即可:number_of_students它会正确生成makefile,尽管我认为disable-sanity-checks会产生一些错误。 >

但是,每当我尝试使用make执行生成的Makefile时,控制台都会显示以下错误:

 start.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            inputValue = edtValue.getText().toString().trim();
            if (inputValue.length() > 0) {
                WindowManager manager = (WindowManager) getSystemService(WINDOW_SERVICE);
                Display display = manager.getDefaultDisplay();
                Point point = new Point();
                display.getSize(point);
                int width = point.x;
                int height = point.y;
                int smallerDimension = width < height ? width : height;
                smallerDimension = smallerDimension * 3 / 4;

                qrgEncoder = new QRGEncoder(
                        inputValue, null,
                        QRGContents.Type.TEXT,
                        smallerDimension);
                try {
                    bitmap = qrgEncoder.encodeAsBitmap();
                    qrImage.setImageBitmap(bitmap);
                } catch (WriterException e) {
                    Log.v(TAG, e.toString());
                }
            } else {
                edtValue.setError("Required");
            }
        }
    });

正如我所说,我尝试添加../configure CFLAGS="-O3 -fPIC" --disable-sanity-checks标志,但仍然没有抓住它。我对make[3]: Leaving directory '/mnt/c/Users/SCP173/Downloads/Thread/glib/glibc/elf' gcc -nostdlib -nostartfiles -shared -o /mnt/c/Users/SCP173/Downloads/Thread/glib/glibc/glibc-build/elf/ld.so.new \ -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs \ /mnt/c/Users/SCP173/Downloads/Thread/glib/glibc/glibc-build/elf/librtld.os -Wl,--version-script=/mnt/c/Users/SCP173/Downloads/Thread/glib/glibc/glibc-build/ld.map \ -Wl,-soname=ld-linux-x86-64.so.2 \ -Wl,-defsym=_begin=0 /mnt/c/Users/SCP173/Downloads/Thread/glib/glibc/glibc-build/elf/librtld.os: In function `process_envvars': /mnt/c/Users/SCP173/Downloads/Thread/glib/glibc/elf/rtld.c:2686: undefined reference to `__GI___open64_nocancel' /usr/bin/ld: /mnt/c/Users/SCP173/Downloads/Thread/glib/glibc/glibc-build/elf/librtld.os: relocation R_X86_64_PC32 against undefined symbol `__GI___open64_nocancel' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status -fPIC和其他扩展名(例如那些扩展名)是新的。我做错了吗?否则,如何使用.os仅编译该文件,而不是将标志传递给整个.map命令?

1 个答案:

答案 0 :(得分:1)

您的文件系统未正确设置。默认情况下,NTFS保留大小写,但不区分大小写。据我了解,WSL的当前版本仅以区分大小写的方式设置文件系统树的一部分。 (现在无需考虑以前的系统范围的配置。)

Building glibc requires a case-sensitive file system.另外请注意,WSL不是glibc的合适开发环境,因为由于WSL内核仿真中的错误而导致大量测试失败。