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

Unable to build shaka-packager with GCC 13- missing stdint fixed bits integer types #1305

Closed
modernletter opened this issue Nov 28, 2023 · 0 comments · Fixed by #1306 or #1312
Closed
Labels
status: archived Archived and locked; will not be updated

Comments

@modernletter
Copy link
Contributor

System info

Operating System: Arch Linux (current@28.11.2023),
Shaka Packager Version: current, 8465f5f
GCC Version: 13.2.1 20230801

Issue and steps to reproduce the problem

Packager Command:

Extra steps to reproduce the problem?

gclient config https://github.com/shaka-project/shaka-packager.git --name=src --unmanaged
GYP_DEFINES='clang=0' gclient sync -r main
cd src
ninja -C out/Release

What is the expected result?
Project compiles.

What happens instead?
Project doesn't compile.

FAILED: obj/base/debug/base.profiler.o 
c++ -MMD -MF obj/base/debug/base.profiler.o.d -DV8_DEPRECATION_WARNINGS -DOpaqueSecTrustRef=__SecACL -DOpaqueSecTrustedApplicationRef=__SecTrustedApplication -D_FILE_OFFSET_BITS=64 -DNO_TCMALLOC -DCHROMIUM_BUILD -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DUSE_SYMBOLIZE -DUSE_LIBPCI=1 -DUSE_NSS_CERTS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DBASE_IMPLEMENTATION -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_FORTIFY_SOURCE=2 -Igen -I../../packager -fstack-protector --param=ssp-buffer-size=4  -pthread -fno-strict-aliasing -Wall -Wno-extra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-unused-local-typedefs -Wno-error -m64 -march=x86-64 -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -Wno-narrowing  -c ../../packager/base/debug/profiler.cc -o obj/base/debug/base.profiler.o
In file included from ../../packager/base/debug/profiler.cc:5:
../../packager/base/debug/profiler.h:59:9: error: ISO C++ forbids declaration of ‘uintptr_t’ with no type [-fpermissive]
   59 | typedef uintptr_t (*ReturnAddressLocationResolver)(
      |         ^~~~~~~~~
../../packager/base/debug/profiler.h:59:9: error: typedef ‘base::debug::uintptr_t’ is initialized (use ‘decltype’ instead)
../../packager/base/debug/profiler.h:59:21: error: ‘ReturnAddressLocationResolver’ was not declared in this scope
   59 | typedef uintptr_t (*ReturnAddressLocationResolver)(
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../packager/base/debug/profiler.h:63:16: error: typedef ‘base::debug::DynamicFunctionEntryHook’ is initialized (use ‘decltype’ instead)
   63 | typedef void (*DynamicFunctionEntryHook)(uintptr_t function,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
../../packager/base/debug/profiler.h:63:42: error: ‘uintptr_t’ was not declared in this scope
   63 | typedef void (*DynamicFunctionEntryHook)(uintptr_t function,
      |                                          ^~~~~~~~~
../../packager/base/debug/profiler.h:13:1: note: ‘uintptr_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?

GCC version 13 needs <cstdint> (or <stdint.h>) to be explicitly included to provide fixed bits integer types. It appears that some source files are actually using e.g. uint64_t without including it.

I would like to propose a PR adding needed includes.

Source: https://gcc.gnu.org/gcc-13/porting_to.html

modernletter added a commit to modernletter/shaka-packager that referenced this issue Nov 28, 2023
GCC version 13 needs <cstdint> to be explicitly included to
provide fixed bits integer types. Some files using it inludes
<stdint.h>, this commit adds <cstdint> inclusion to the
missing ones and it's needed to compile project on GCC 13.

Source: https://gcc.gnu.org/gcc-13/porting_to.html
cosmin pushed a commit that referenced this issue Nov 30, 2023
CC version 13 needs `<cstdint>` to be explicitly included to
provide fixed bits integer types.

Some files using it inludes `<stdint.h>`, some are missing direct or
undirect inclusion. This PR adds `<cstdint>` inclusion to the
minimal set of files, allowing compilation on GCC 13.

Closes #1305
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jan 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
1 participant