8000 Linking problem undef reference 'xcb_prefetch_maximum_request_length' · Issue #1628 · polybar/polybar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Linking problem undef reference 'xcb_prefetch_maximum_request_length' #1628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jubalh opened this issue Jan 25, 2019 · 3 comments
Closed

Linking problem undef reference 'xcb_prefetch_maximum_request_length' #1628

jubalh opened this issue Jan 25, 2019 · 3 comments

Comments

@jubalh
Copy link
Contributor
jubalh commented Jan 25, 2019

It seems when I compile polybar with CMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now"
The build aborts with:

libpoly.a(bar.cpp.o): undefined reference to symbol 'xcb_prefetch_maximum_request_length'

Build Process

Using 3.3.0 tarball.

We have a general cmake macro which expands to:

    find . -name CMakeLists.txt \
        -exec sed -i -re '/^[[:blank:]]*[sS][eE][tT][[:blank:]]*\([[:blank:]]*(CMAKE_BUILD_TYPE|CMAKE_COLOR_MAKEFILE|CMAKE_INSTALL_PREFIX|CMAKE_VERBOSE_MAKEFILE).*\)/{s/^/#IGNORE /}' {} + 
    mkdir -p build 
    cd build 
    /usr/bin/cmake $OLDPWD/. \
%if "/usr/bin/make" == "/usr/bin/make" 
        -G"Unix Makefiles" \
%else 
        -GNinja \
%endif 
        -DCMAKE_INSTALL_PREFIX:PATH=/usr \
        -DINCLUDE_INSTALL_DIR:PATH=/usr/include \
        -DLIB_INSTALL_DIR:PATH=/usr/lib64 \
        -DSYSCONF_INSTALL_DIR:PATH=/etc \
        -DSHARE_INSTALL_PREFIX:PATH=/usr/share \
        -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64 \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        -DCMAKE_C_FLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \
        -DCMAKE_CXX_FLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \
        -DCMAKE_Fortran_FLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \
        -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \
        -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed" \
        -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \
%if "lib64" == "lib64" 
        -DLIB_SUFFIX=64 \
%endif 
        -DCMAKE_SKIP_RPATH:BOOL=ON \
        -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
        -DBUILD_SHARED_LIBS:BOOL=ON \
        -DBUILD_STATIC_LIBS:BOOL=OFF \
        -DCMAKE_COLOR_MAKEFILE:BOOL=OFF \
        -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \
        -DCMAKE_MODULES_INSTALL_DIR=/usr/share/cmake/Modules

After that:

make
make install

but we don't get to that.

Build Log

Complete build log can be found here

Environment:

openSUSE Tumbleweed OBS

Additional context

I'm in the process to update syseks spec file so polybar can become part of the official distribution. All building happens in the OpenBuildSystem.
I tried to explain the steps taken above independent of the OBS.

The modified spec file can be seen here

sysek's spec file calls, mkdir build; cd build; cmake .. which builds find fine.
To get polybar into official devel repositories and then into the distro we should use the macros. My guess is that CMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now create trouble. Maybe something isn't defined in the CMakeList.txt, like -lxcb might be missing.

The diff between his package and my attempt to clean it up can be seen here

@patrick96
Copy link
Member

Alright, was finally able to track down the issue. The issue is the -DBUILD 8000 _SHARED_LIBS:BOOL=ON setting. This messes up how the xpp submodule is built because it's now built as a shared library (before it was static). I'm able to fix this on our end inside the xpp submodule by explicitly specifying the library type but it will be a while until that gets into a release (the PR needs to be merged into the submodule repo and then we need a PR to update the submodule reference and we need to create a new release), but we should be able to get it into 3.3.1 or 3.3.2. Until then, if -DBUILD_SHARED_LIBS:BOOL=ON is not strictly necessary, consider dropping it for the build.

patrick96 added a commit to patrick96/xpp that referenced this issue Jan 27, 2019
If BUILD_SHARED_LIBS is set to ON, xpp will build as a shared library
which we don't want.

Ref polybar/polybar#1628
@jubalh
Copy link
Contributor Author
jubalh commented Jan 28, 2019

Thanks. I created a submit request to syseks home with a patch that contains your fix.

@jubalh jubalh closed this as completed Jan 28, 2019
@patrick96
Copy link
Member

Awesome, I hope this gets into the official repos :)

patrick96 added a commit to polybar/xpp that referenced this issue Feb 7, 2019
If BUILD_SHARED_LIBS is set to ON, xpp will build as a shared library
which we don't want.

Ref polybar/polybar#1628
patrick96 added a commit to patrick96/polybar that referenced this issue Feb 7, 2019
This fixes the link failure when configured with -DBUILD_SHARED_LIBS=ON
as reported in polybar#1628. xpp will now always build a static lib

Ref polybar/xpp#15
patrick96 added a commit to patrick96/polybar that referenced this issue Feb 18, 2019
This fixes the link failure when configured with -DBUILD_SHARED_LIBS=ON
as reported in polybar#1628. xpp will now always build a static lib

Ref polybar/xpp#15
patrick96 added a commit that referenced this issue Feb 18, 2019
This fixes the link failure when configured with -DBUILD_SHARED_LIBS=ON
as reported in #1628. xpp will now always build a static lib

Ref polybar/xpp#15
patrick96 10000 added a commit that referenced this issue Mar 25, 2019
This fixes the link failure when configured with -DBUILD_SHARED_LIBS=ON
as reported in #1628. xpp will now always build a static lib

Ref polybar/xpp#15
patrick96 added a commit that referenced this issue Mar 25, 2019
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (#1576), see #1462
    * Workspace removal not always detected (#1579), see #1491, #248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (#1591), see #975
* `internal/fs`: Incorrect sizes on some machines (#1612, #1699), see #743
* `internal/network`: Buffer overflow with ipv6 addresses (#1514)
* renderer: Show proper error when imagemagick is used to set the background (#1608), see #1582, #1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (#1571)
    * Build failure on clang8 (#1675), #1674
    * Allow negative offset values for `tray-offset-*` (#1669), see #1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (#1647, polybar/xpp#15), see #1628
* controller: Crash when reloading via `SIGUSR1` too fast (#1678), #428
patrick96 added a commit that referenced this issue Mar 25, 2019
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (#1576), see #1462
    * Workspace removal not always detected (#1579), see #1491, #248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (#1591), see #975
* `internal/fs`: Incorrect sizes on some machines (#1612, #1699), see #743
* `internal/network`: Buffer overflow with ipv6 addresses (#1514)
* renderer: Show proper error when imagemagick is used to set the background (#1608), see #1582, #1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (#1571)
    * Build failure on clang8 (#1675), #1674
    * Allow negative offset values for `tray-offset-*` (#1669), see #1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (#1647, polybar/xpp#15), see #1628
* controller: Crash when reloading via `SIGUSR1` too fast (#1678), #428
doronbehar pushed a commit to doronbehar/polybar that referenced this issue Aug 5, 2019
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (polybar#1576), see polybar#1462
    * Workspace removal not always detected (polybar#1579), see polybar#1491, polybar#248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (polybar#1591), see polybar#975
* `internal/fs`: Incorrect sizes on some machines (polybar#1612, polybar#1699), see polybar#743
* `internal/network`: Buffer overflow with ipv6 addresses (polybar#1514)
* renderer: Show proper error when imagemagick is used to set the background (polybar#1608), see polybar#1582, polybar#1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (polybar#1571)
    * Build failure on clang8 (polybar#1675), polybar#1674
    * Allow negative offset values for `tray-offset-*` (polybar#1669), see polybar#1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (polybar#1647, polybar/xpp#15), see polybar#1628
* controller: Crash when reloading via `SIGUSR1` too fast (polybar#1678), polybar#428
doronbehar pushed a commit to doronbehar/polybar that referenced this issue Feb 11, 2020
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (polybar#1576), see polybar#1462
    * Workspace removal not always detected (polybar#1579), see polybar#1491, polybar#248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (polybar#1591), see polybar#975
* `internal/fs`: Incorrect sizes on some machines (polybar#1612, polybar#1699), see polybar#743
* `internal/network`: Buffer overflow with ipv6 addresses (polybar#1514)
* renderer: Show proper error when imagemagick is used to set the background (polybar#1608), see polybar#1582, polybar#1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (polybar#1571)
    * Build failure on clang8 (polybar#1675), polybar#1674
    * Allow negative offset values for `tray-offset-*` (polybar#1669), see polybar#1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (polybar#1647, polybar/xpp#15), see polybar#1628
* controller: Crash when reloading via `SIGUSR1` too fast (polybar#1678), polybar#428
doronbehar pushed a commit to doronbehar/polybar that referenced this issue Mar 19, 2020
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (polybar#1576), see polybar#1462
    * Workspace removal not always detected (polybar#1579), see polybar#1491, polybar#248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (polybar#1591), see polybar#975
* `internal/fs`: Incorrect sizes on some machines (polybar#1612, polybar#1699), see polybar#743
* `internal/network`: Buffer overflow with ipv6 addresses (polybar#1514)
* renderer: Show proper error when imagemagick is used to set the background (polybar#1608), see polybar#1582, polybar#1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (polybar#1571)
    * Build failure on clang8 (polybar#1675), polybar#1674
    * Allow negative offset values for `tray-offset-*` (polybar#1669), see polybar#1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (polybar#1647, polybar/xpp#15), see polybar#1628
* controller: Crash when reloading via `SIGUSR1` too fast (polybar#1678), polybar#428
doronbehar pushed a commit to doronbehar/polybar that referenced this issue Mar 19, 2020
Changelog

Fixes:
* `internal/xworkspaces`:
    * Crash when WM doesn't set `_NET_DESKTOP_NAMES` (polybar#1576), see polybar#1462
    * Workspace removal not always detected (polybar#1579), see polybar#1491, polybar#248
* `internal/i3`: Crash when `<label-state>` was not added to `format` (polybar#1591), see polybar#975
* `internal/fs`: Incorrect sizes on some machines (polybar#1612, polybar#1699), see polybar#743
* `internal/network`: Buffer overflow with ipv6 addresses (polybar#1514)
* renderer: Show proper error when imagemagick is used to set the background (polybar#1608), see polybar#1582, polybar#1585
* tray:
    * Wrong background for transparent trays when using `tray-offset-*` (polybar#1571)
    * Build failure on clang8 (polybar#1675), polybar#1674
    * Allow negative offset values for `tray-offset-*` (polybar#1669), see polybar#1666
* build: Link failure when configuring with `-DBUILD_SHARED_LIBS=ON` (polybar#1647, polybar/xpp#15), see polybar#1628
* controller: Crash when reloading via `SIGUSR1` too fast (polybar#1678), polybar#428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0