microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.34k stars 6.45k forks source link

[GLIB] build failure - Centos 7 #19558

Closed Pixel-Minions closed 3 days ago

Pixel-Minions commented 3 years ago

Host Environment

To Reproduce Steps to reproduce the behavior: ./vcpkg install glib

Failure logs

Building package pcre[core]:x64-linux... done
Installing package pcre[core]:x64-linux...
Installing package pcre[core]:x64-linux... done
Elapsed time for package pcre:x64-linux: 16.35 ms
Starting package 77/96: tool-meson:x64-linux
Building package tool-meson[core]:x64-linux...
Building package tool-meson[core]:x64-linux... done
Installing package tool-meson[core]:x64-linux...
Installing package tool-meson[core]:x64-linux... done
Elapsed time for package tool-meson:x64-linux: 9.22 ms
Starting package 78/96: zlib:x64-linux
Building package zlib[core]:x64-linux...
Building package zlib[core]:x64-linux... done
Installing package zlib[core]:x64-linux...
Installing package zlib[core]:x64-linux... done
Elapsed time for package zlib:x64-linux: 10.47 ms
Starting package 79/96: glib:x64-linux
Building package glib[core]:x64-linux...
-- Installing port from location: /mnt/ci_runner_tmp/temp/runner/ci_test/builds/1G2iXpzG/0/pixomondo/external/openimageio/ports/glib
-- Downloading https://ftp.gnome.org/pub/gnome/sources/glib/2.66/glib-2.66.4.tar.xz -> glib-2.66.4.tar.xz...
-- Extracting source /tmp/rez_builder_iwSvwF/downloads/glib-2.66.4.tar.xz
-- Applying patch use-libiconv-on-windows.patch
-- Applying patch fix-libintl-detection.patch
-- Using source at /tmp/rez_builder_iwSvwF/buildtrees/glib/src/glib-2-898dbb95db.clean
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Downloading https://github.com/mesonbuild/meson/archive/753954be868ed78b3e339e8811fd1d29eb2af237.tar.gz -> meson-753954be868ed78b3e339e8811fd1d29eb2af237.tar.gz...
-- Configuring x64-linux-dbg
-- Configuring x64-linux-dbg done
-- Configuring x64-linux-rel
-- Configuring x64-linux-rel done
-- Package x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:105 (message):
    Command failed: /tmp/rez_builder_iwSvwF/downloads/tools/ninja-1.10.1-linux/ninja install -v
    Working Directory: /tmp/rez_builder_iwSvwF/buildtrees/glib/x64-linux-dbg
    Error code: 1
    See logs for more information:
      /tmp/rez_builder_iwSvwF/buildtrees/glib/package-x64-linux-dbg-out.log
Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_meson.cmake:58 (vcpkg_execute_required_process)
  /mnt/ci_runner_tmp/temp/runner/ci_test/builds/1G2iXpzG/0/pixomondo/external/openimageio/ports/glib/portfile.cmake:56 (vcpkg_install_meson)
  scripts/ports.cmake:142 (include)
Error: Building package glib:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: glib:x64-linux
  Vcpkg version: 2021-05-05-unknownhash
Additionally, attach any relevant sections from the log files above.
' returned non-zero exit status 1
14:43:58 ERROR    BuildError: The custom build system failed.
[710/1173] /opt/rh/devtoolset-7/root/usr/bin/cc  -o gio/tests/async-splice-output-stream gio/tests/async-splice-output-stream.p/async-splice-output-stream.c.o -L/root/vcpkg/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group glib/libglib-2.0.a gmodule/libgmodule-2.0.a gobject/libgobject-2.0.a gio/libgio-2.0.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a -pthread -ldl /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a -lresolv -Wl,--end-group
[711/1173] /opt/rh/devtoolset-7/root/usr/bin/cc  -o gio/tests/buffered-output-stream gio/tests/buffered-output-stream.p/buffered-output-stream.c.o -L/root/vcpkg/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group glib/libglib-2.0.a gmodule/libgmodule-2.0.a gobject/libgobject-2.0.a gio/libgio-2.0.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a -pthread -ldl /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a -lresolv -Wl,--end-group
[712/1173] /opt/rh/devtoolset-7/root/usr/bin/cc  -o gio/tests/libresourceplugin.so gio/tests/libresourceplugin.so.p/meson-generated_.._plugin-resources.c.o gio/tests/libresourceplugin.so.p/resourceplugin.c.o -L/root/vcpkg/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libresourceplugin.so glib/libglib-2.0.a gmodule/libgmodule-2.0.a gobject/libgobject-2.0.a gio/libgio-2.0.a -Wl,--export-dynamic /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a -pthread -ldl /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a -lresolv -Wl,--end-group
FAILED: gio/tests/libresourceplugin.so
/opt/rh/devtoolset-7/root/usr/bin/cc  -o gio/tests/libresourceplugin.so gio/tests/libresourceplugin.so.p/meson-generated_.._plugin-resources.c.o gio/tests/libresourceplugin.so.p/resourceplugin.c.o -L/root/vcpkg/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libresourceplugin.so glib/libglib-2.0.a gmodule/libgmodule-2.0.a gobject/libgobject-2.0.a gio/libgio-2.0.a -Wl,--export-dynamic /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a -pthread -ldl /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a -lresolv -Wl,--end-group
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a(unix64.S.o): relocation R_X86_64_PC32 against symbol `abort@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
[713/1173] /opt/rh/devtoolset-7/root/usr/bin/cc  -o gio/tests/buffered-input-stream gio/tests/buffered-input-stream.p/buffered-input-stream.c.o -L/root/vcpkg/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group glib/libglib-2.0.a gmodule/libgmodule-2.0.a gobject/libgobject-2.0.a gio/libgio-2.0.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a -pthread -ldl /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a -lresolv -Wl,--end-group
[714/1173] /opt/rh/devtoolset-7/root/usr/bin/cc  -o gio/tests/autoptr-gio gio/tests/autoptr-gio.p/autoptr.c.o -L/root/vcpkg/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group glib/libglib-2.0.a gmodule/libgmodule-2.0.a gobject/libgobject-2.0.a gio/libgio-2.0.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a -pthread -ldl /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a -lresolv -Wl,--end-group
[715/1173] /opt/rh/devtoolset-7/root/usr/bin/cc  -o gio/tests/contenttype gio/tests/contenttype.p/contenttype.c.o -L/root/vcpkg/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group glib/libglib-2.0.a gmodule/libgmodule-2.0.a gobject/libgobject-2.0.a gio/libgio-2.0.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a -pthread -ldl /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a -lresolv -Wl,--end-group
[716/1173] /opt/rh/devtoolset-7/root/usr/bin/cc -Igio/tests/dbus-appinfo.p -Igio/tests -I../src/glib-2-b84205c786.clean/gio/tests -I. -I../src/glib-2-b84205c786.clean -Iglib -I../src/glib-2-b84205c786.clean/glib -Igmodule -I../src/glib-2-b84205c786.clean/gmodule -Igobject -I../src/glib-2-b84205c786.clean/gobject -Igio -I../src/glib-2-b84205c786.clean/gio '-I"/root/vcpkg/installed/x64-linux/include"' -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -Wduplicated-branches -Wimplicit-fallthrough -Wmisleading-indentation -Wstrict-prototypes -Wunused -Wno-unused-parameter -Wno-bad-function-cast -Wno-pedantic -Wno-format-zero-length -Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration -Werror=init-self -Werror=missing-prototypes -Werror=pointer-arith -fPIC -g '-DG_LOG_DOMAIN="GLib-GIO"' '-DGLIB_MKENUMS="gobject/glib-mkenums"' '-DGLIB_COMPILE_SCHEMAS="/root/vcpkg/buildtrees/glib/x64-linux-dbg/gio/glib-compile-schemas"' -UG_DISABLE_ASSERT -MD -MQ gio/tests/dbus-appinfo.p/dbus-appinfo.c.o -MF gio/tests/dbus-appinfo.p/dbus-appinfo.c.o.d -o gio/tests/dbus-appinfo.p/dbus-appinfo.c.o -c ../src/glib-2-b84205c786.clean/gio/tests/dbus-appinfo.c
[717/1173] /opt/rh/devtoolset-7/root/usr/bin/cc -Igio/tests/data-output-stream.p -Igio/tests -I../src/glib-2-b84205c786.clean/gio/tests -I. -I../src/glib-2-b84205c786.clean -Iglib -I../src/glib-2-b84205c786.clean/glib -Igmodule -I../src/glib-2-b84205c786.clean/gmodule -Igobject -I../src/glib-2-b84205c786.clean/gobject -Igio -I../src/glib-2-b84205c786.clean/gio '-I"/root/vcpkg/installed/x64-linux/include"' -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -Wduplicated-branches -Wimplicit-fallthrough -Wmisleading-indentation -Wstrict-prototypes -Wunused -Wno-unused-parameter -Wno-bad-function-cast -Wno-pedantic -Wno-format-zero-length -Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration -Werror=init-self -Werror=missing-prototypes -Werror=pointer-arith -fPIC -g '-DG_LOG_DOMAIN="GLib-GIO"' '-DGLIB_MKENUMS="gobject/glib-mkenums"' '-DGLIB_COMPILE_SCHEMAS="/root/vcpkg/buildtrees/glib/x64-linux-dbg/gio/glib-compile-schemas"' -UG_DISABLE_ASSERT -MD -MQ gio/tests/data-output-stream.p/data-output-stream.c.o -MF gio/tests/data-output-stream.p/data-output-stream.c.o.d -o gio/tests/data-output-stream.p/data-output-stream.c.o -c ../src/glib-2-b84205c786.clean/gio/tests/data-output-stream.c
[718/1173] /opt/rh/devtoolset-7/root/usr/bin/cc -Igio/tests/data-input-stream.p -Igio/tests -I../src/glib-2-b84205c786.clean/gio/tests -I. -I../src/glib-2-b84205c786.clean -Iglib -I../src/glib-2-b84205c786.clean/glib -Igmodule -I../src/glib-2-b84205c786.clean/gmodule -Igobject -I../src/glib-2-b84205c786.clean/gobject -Igio -I../src/glib-2-b84205c786.clean/gio '-I"/root/vcpkg/installed/x64-linux/include"' -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -g -D_GNU_SOURCE -fno-strict-aliasing -DG_ENABLE_DEBUG -Wduplicated-branches -Wimplicit-fallthrough -Wmisleading-indentation -Wstrict-prototypes -Wunused -Wno-unused-parameter -Wno-bad-function-cast -Wno-pedantic -Wno-format-zero-length -Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration -Werror=init-self -Werror=missing-prototypes -Werror=pointer-arith -fPIC -g '-DG_LOG_DOMAIN="GLib-GIO"' '-DGLIB_MKENUMS="gobject/glib-mkenums"' '-DGLIB_COMPILE_SCHEMAS="/root/vcpkg/buildtrees/glib/x64-linux-dbg/gio/glib-compile-schemas"' -UG_DISABLE_ASSERT -MD -MQ gio/tests/data-input-stream.p/data-input-stream.c.o -MF gio/tests/data-input-stream.p/data-input-stream.c.o.d -o gio/tests/data-input-stream.p/data-input-stream.c.o -c ../src/glib-2-b84205c786.clean/gio/tests/data-input-stream.c
[719/1173] /opt/rh/devtoolset-7/root/usr/bin/cc  -o gio/tests/contexts gio/tests/contexts.p/contexts.c.o -L/root/vcpkg/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group glib/libglib-2.0.a gmodule/libgmodule-2.0.a gobject/libgobject-2.0.a gio/libgio-2.0.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a -pthread -ldl /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a -lresolv -Wl,--end-group
[720/1173] /opt/rh/devtoolset-7/root/usr/bin/cc  -o gio/tests/credentials gio/tests/credentials.p/credentials.c.o -L/root/vcpkg/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group glib/libglib-2.0.a gmodule/libgmodule-2.0.a gobject/libgobject-2.0.a gio/libgio-2.0.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a -pthread -ldl /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a -lresolv -Wl,--end-group
[721/1173] /opt/rh/devtoolset-7/root/usr/bin/cc  -o gio/tests/converter-stream gio/tests/converter-stream.p/converter-stream.c.o -L/root/vcpkg/installed/x64-linux/debug/lib -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group glib/libglib-2.0.a gmodule/libgmodule-2.0.a gobject/libgobject-2.0.a gio/libgio-2.0.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libpcre.a -pthread -ldl /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libz.a -lresolv -Wl,--end-group
ninja: build stopped: subcommand failed.

Additional context I have tried compiling older versions of glib and libffi with no result, I also have tried in multiple devices and fails all the times in Centos, but Windows 10 and Windows 7 works fine.

Pixel-Minions commented 3 years ago

@JackBoosY Hi, is there any information additionally I can provide to solve the issue?

JackBoosY commented 3 years ago
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /root/vcpkg/installed/x64-linux/debug/lib/pkgconfig/../../lib/libffi.a(unix64.S.o): relocation R_X86_64_PC32 against symbol `abort@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC

This is very different with mine, can you please provide the config logs _/tmp/rez_builderiwSvwF/buildtrees/glib/config-x64-linux-dbg-out.log and _/tmp/rez_builderiwSvwF/buildtrees/glib/config-x64-linux-dbg-err.log?

And I think I saw this error before...

Pixel-Minions commented 3 years ago

config-x64-linux-dbg-out.log package-x64-linux-dbg-out.log

@JackBoosY The config-x64-linux-dbg-err.log is empty, nothing gets added there.

Pixel-Minions commented 3 years ago

@JackBoosY I wonder if it is related to shared libraries missing when compiling the libffi, I recompiled using set(CMAKE_POSITION_INDEPENDENT_CODE ON) to force the flag fPIC in the libffi port file but no luck.

jmacey commented 3 years ago

Just to say I was having the same issue, I did the following.

  1. add set(CMAKE_POSITION_INDEPENDENT_CODE ON) to ports/libffi/CMakeLists.txt (near the top)
  2. vcpkg remove libffi
  3. vcpkg install libffi
  4. edit ports/glib/vcpkg.json and remove libffi as a dep (not sure if this is needed).

It has now installed. I'm now testing a build against it.

This is on RHEL 7.7 using the latest devtools7 and latest vcpkg .

JackBoosY commented 3 years ago

So I confirm this issue is due to libffi.

jimwang118 commented 1 year ago

Not reproduced on Ubuntu with the latest version of vcpkg.

github-actions[bot] commented 3 weeks ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.