Skip to content
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

Linux: Fix build with use_sowrap=no and various warnings/errors #79097

Merged

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Jul 6, 2023

Follow-up to #74978 and #76961.
Still testing it, some more changes might be needed.

Fixes this error and these warnings:

platform/linuxbsd/x11/display_server_x11.cpp: In constructor 'DisplayServerX11::DisplayServerX11(const String&, DisplayServer::WindowMode, DisplayServer::VSyncMode, uint32_t, const Vector2i*, const Vector2i&, int, Error&)':
platform/linuxbsd/x11/display_server_x11.cpp:5452:9: error: 'xkb_loaded' was not declared in this scope
 5452 |         xkb_loaded = true;
      |         ^~~~~~~~~~
platform/linuxbsd/x11/display_server_x11.cpp:5480:22: warning: the address of 'XcursorImage* XcursorImageCreate(int, int)' will never be NULL [-Waddress]
 5480 |                 if (!XcursorImageCreate || !XcursorImageLoadCursor || !XcursorImageDestroy || !XcursorGetDefaultSize || !XcursorGetTheme || !XcursorLibraryLoadImage) {
      |                      ^~~~~~~~~~~~~~~~~~
In file included from platform/linuxbsd/x11/display_server_x11.h:91,
                 from platform/linuxbsd/x11/display_server_x11.cpp:31:
/usr/include/X11/Xcursor/Xcursor.h:237:1: note: 'XcursorImage* XcursorImageCreate(int, int)' declared here
  237 | XcursorImageCreate (int width, int height);
      | ^~~~~~~~~~~~~~~~~~
platform/linuxbsd/x11/display_server_x11.cpp:5480:45: warning: the address of 'Cursor XcursorImageLoadCursor(Display*, const XcursorImage*)' will never be NULL [-Waddress]
 5480 |                 if (!XcursorImageCreate || !XcursorImageLoadCursor || !XcursorImageDestroy || !XcursorGetDefaultSize || !XcursorGetTheme || !XcursorLibraryLoadImage) {
      |                                             ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/X11/Xcursor/Xcursor.h:386:1: note: 'Cursor XcursorImageLoadCursor(Display*, const XcursorImage*)' declared here
  386 | XcursorImageLoadCursor (Display *dpy, const XcursorImage *image);
      | ^~~~~~~~~~~~~~~~~~~~~~
platform/linuxbsd/x11/display_server_x11.cpp:5480:72: warning: the address of 'void XcursorImageDestroy(XcursorImage*)' will never be NULL [-Waddress]
 5480 |                 if (!XcursorImageCreate || !XcursorImageLoadCursor || !XcursorImageDestroy || !XcursorGetDefaultSize || !XcursorGetTheme || !XcursorLibraryLoadImage) {
      |                                                                        ^~~~~~~~~~~~~~~~~~~
/usr/include/X11/Xcursor/Xcursor.h:240:1: note: 'void XcursorImageDestroy(XcursorImage*)' declared here
  240 | XcursorImageDestroy (XcursorImage *image);
      | ^~~~~~~~~~~~~~~~~~~
platform/linuxbsd/x11/display_server_x11.cpp:5480:96: warning: the address of 'int XcursorGetDefaultSize(Display*)' will never be NULL [-Waddress]
 5480 |                 if (!XcursorImageCreate || !XcursorImageLoadCursor || !XcursorImageDestroy || !XcursorGetDefaultSize || !XcursorGetTheme || !XcursorLibraryLoadImage) {
      |                                                                                                ^~~~~~~~~~~~~~~~~~~~~
/usr/include/X11/Xcursor/Xcursor.h:485:1: note: 'int XcursorGetDefaultSize(Display*)' declared here
  485 | XcursorGetDefaultSize (Display *dpy);
      | ^~~~~~~~~~~~~~~~~~~~~
platform/linuxbsd/x11/display_server_x11.cpp:5480:122: warning: the address of 'char* XcursorGetTheme(Display*)' will never be NULL [-Waddress]
 5480 |                 if (!XcursorImageCreate || !XcursorImageLoadCursor || !XcursorImageDestroy || !XcursorGetDefaultSize || !XcursorGetTheme || !XcursorLibraryLoadImage) {
      |                                                                                                                          ^~~~~~~~~~~~~~~
/usr/include/X11/Xcursor/Xcursor.h:491:1: note: 'char* XcursorGetTheme(Display*)' declared here
  491 | XcursorGetTheme (Display *dpy);
      | ^~~~~~~~~~~~~~~
platform/linuxbsd/x11/display_server_x11.cpp:5480:142: warning: the address of 'XcursorImage* XcursorLibraryLoadImage(const char*, const char*, int)' will never be NULL [-Waddress]
 5480 |                 if (!XcursorImageCreate || !XcursorImageLoadCursor || !XcursorImageDestroy || !XcursorGetDefaultSize || !XcursorGetTheme || !XcursorLibraryLoadImage) {
      |                                                                                                                                              ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/X11/Xcursor/Xcursor.h:366:1: note: 'XcursorImage* XcursorLibraryLoadImage(const char*, const char*, int)' declared here
  366 | XcursorLibraryLoadImage (const char *library, const char *theme, int size);
      | ^~~~~~~~~~~~~~~~~~~~~~~
Compiling thirdparty/astcenc/astcenc_c

And this warning which exposed a logic bug:

platform/linuxbsd/joypad_linux.cpp:80:13: warning: 'bool detect_sandbox()' defined but not used [-Wunused-function]
   80 | static bool detect_sandbox() {
      |             ^~~~~~~~~~~~~~

@akien-mga akien-mga added bug topic:buildsystem topic:porting regression cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Jul 6, 2023
@akien-mga akien-mga added this to the 4.2 milestone Jul 6, 2023
@akien-mga akien-mga changed the title Linux: Fix build with use_sowrap=no Linux: Fix build with use_sowrap=no and various warnings/errors Jul 6, 2023
@akien-mga akien-mga force-pushed the linux-fix-use_sowrap-no-build branch from bf4ddfd to 00a12a9 Compare July 6, 2023 12:52
@akien-mga akien-mga marked this pull request as ready for review July 6, 2023 13:05
@akien-mga akien-mga requested a review from a team as a code owner July 6, 2023 13:05
@akien-mga akien-mga requested a review from bruvzg July 6, 2023 13:07
@Riteo
Copy link
Contributor

Riteo commented Jul 6, 2023

@akien-mga

Still testing it

Should this be marked as a draft or should we review anyways?

@akien-mga
Copy link
Member Author

It passed building on the Mageia buildsystem with this so it should be good to review. I'll still do some sanity checks on the generated package before merging.

@akien-mga akien-mga force-pushed the linux-fix-use_sowrap-no-build branch from 48c4b09 to dcd16a5 Compare July 10, 2023 12:34
@akien-mga akien-mga requested a review from bruvzg July 10, 2023 12:45
@akien-mga akien-mga merged commit 659ccb3 into godotengine:master Jul 11, 2023
@akien-mga akien-mga deleted the linux-fix-use_sowrap-no-build branch July 11, 2023 09:32
@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jul 11, 2023
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants