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: not used because `__STDC_CONSTANT_MACROS' is defined [-Winvalid-pch] #1818

Closed
orbea opened this issue Jun 24, 2016 · 28 comments
Closed

Comments

@orbea
Copy link
Contributor

orbea commented Jun 24, 2016

OS: Slackware64-current
gcc-5.3.0_multilib-x86_64-3alien
llvm-3.8.0-x86_64-2

Although rpcs3 does compile, the entire build process is warning about not used because __STDC_CONSTANT_MACROS is defined [-Winvalid-pch]. Is there anything that can be done to solve these warnings?

[100%] Building CXX object rpcs3/CMakeFiles/rpcs3.dir/__/asmjit/src/asmjit/base/assembler.cpp.o
cd /tmp/SBo/rpcs3/build/rpcs3 && /usr/bin/c++   -DCMAKE_BUILD -DGLX_GLXEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DLLVM_AVAILABLE -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -DwxGUI -isystem /usr/lib64/wx/include/gtk2-unicode-3.0 -isystem /usr/include/wx-3.0 -I/usr/include/AL -I/tmp/SBo/rpcs3/rpcs3/../3rdparty/pugixml/src -I/tmp/SBo/rpcs3/rpcs3/../3rdparty/ffmpeg/linux/x86_64/include -I/tmp/SBo/rpcs3/rpcs3 -I/tmp/SBo/rpcs3/rpcs3/Loader -I/tmp/SBo/rpcs3/rpcs3/Crypto -I/tmp/SBo/rpcs3/rpcs3/.. -I/tmp/SBo/rpcs3/rpcs3/../Utilities/yaml-cpp/include -I/tmp/SBo/rpcs3/rpcs3/../asmjit/src/asmjit -I/tmp/SBo/rpcs3/rpcs3/../3rdparty/libpng -I/tmp/SBo/rpcs3/rpcs3/../3rdparty/GSL/include -I/tmp/SBo/rpcs3/rpcs3/../rsx_program_decompiler/rsx_decompiler -I/tmp/SBo/rpcs3/rpcs3/../rsx_program_decompiler/shader_code -I/tmp/SBo/rpcs3/rpcs3/../Vulkan/Vulkan-LoaderAndValidationLayers/include -I/tmp/SBo/rpcs3/rpcs3/../Vulkan/glslang/glslang/Public -I/tmp/SBo/rpcs3/rpcs3/../3rdparty/GL -I/tmp/SBo/rpcs3/rpcs3/../3rdparty/stblib  -O2 -fPIC -std=c++14 -fexceptions -pthread -O3 -DNDEBUG   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wno-attributes -Wno-enum-compare -Wno-invalid-offsetof -msse -msse2 -mcx16 -mssse3 -march=native -Winvalid-pch -include /tmp/SBo/rpcs3/build/rpcs3/cotire/rpcs3_CXX_prefix.hxx -o CMakeFiles/rpcs3.dir/__/asmjit/src/asmjit/base/assembler.cpp.o -c /tmp/SBo/rpcs3/asmjit/src/asmjit/base/assembler.cpp
cc1plus: warning: /tmp/SBo/rpcs3/build/rpcs3/cotire/rpcs3_CXX_prefix.hxx.gch: not used because `__STDC_CONSTANT_MACROS' is defined [-Winvalid-pch]

Full log - http://ks392457.kimsufi.com/orbea/stuff/logs/rpcs3-build.log

@rcaridade145
Copy link

This seems like this issue - http://stackoverflow.com/questions/986426/what-do-stdc-limit-macros-and-stdc-constant-macros-mean - wonder if defining -std=c11 would fix this. I notice you are using an alien package any reason why?

@dbz400 dbz400 changed the title cc1plus: warning: not used because `__STDC_CONSTANT_MACROS' is defined [-Winvalid-pch] Linux: not used because `__STDC_CONSTANT_MACROS' is defined [-Winvalid-pch] Jun 24, 2016
@orbea
Copy link
Contributor Author

orbea commented Jun 24, 2016

The alien package is a multilib equivalent of the standard Slackware gcc made by one of the Slackware maintainers (Alienbob) which I use to build programs like wine or pcsx2. It should not make a difference here.

I tried defining -std=c11 for both -DCMAKE_C_FLAGS and -DCMAKE_CXX_FLAGS. The latter predictably causes a new warning while the former does not make much of a difference.

cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++

So I then tried to define -std=c++11 for -DCMAKE_CXX_FLAGS and found that it did not make a difference either.

@mrcmunir
Copy link

mrcmunir commented Jun 25, 2016

Also need update submodule GLSLang because missing header in

Vulkan/glslang/glslang/MachineIndependent/intermOut.cpp:52:10: error: ‘__builtin_isinf_sign’ is not a member of ‘std’

Missing #include cmath in that file.

In the actual code in github KhronosGroup/GLSLang are fixed 👍

@dbz400
Copy link
Contributor

dbz400 commented Jun 26, 2016

Thanks for pointing this out @maximu

Feel free to send out pull to update the glslang submodule .

@mrcmunir
Copy link

the main problem for the actual glslang code is new dependences so it's problematic linker/path cmake error under some OS need studing before pull request.

Also first need fix Acces violation reading location and rpcs3 can't open

[mrc@Mrc-munir bin]$ ./rpcs3
vm::g_base_addr = 0x7fe3413d5000
vm::g_priv_addr = 0x7fe2413d5000
Fatal error:
Access violation reading location (nil) at 0x7fe447f826a6.
HOW TO REPORT ERRORS:

  1. Check the FAQ, readme, other sources. Please ensure that your hardware and software configuration is compliant.
  2. You must provide FULL information: how to reproduce the error (your actions), RPCS3.log file, other *.log files whenever requested.
  3. Please ensure that your software (game) is 'Playable' or close. Please note that 'Non-playable' games will be ignored.
  4. If the software (game) is not 'Playable', please ensure that this error is unexpected, i.e. it didn't happen before or similar.
    Please, don't send incorrect reports. Thanks for understanding.
    ^CAvortat (bolcat de la imatge del nucli)

Maybe I miss in some part ???

@mrcmunir
Copy link

mrcmunir commented Jun 27, 2016

Well I detected that error reported by libpng16 static with Libpng in my system running ok...

We maybe remove libpng static under linux beucase break relocations problem.

@magiruuvelvet
Copy link
Contributor

@maximu see this cmake tweak here #1825 which still isn't merged yet :/
It adds the possibility to build against the shared libpng from the system.

@mrcmunir
Copy link

I'm update in my repository https://github.com/maximu/rpcs3
Updated Vulkan-loader
Updated Glslang (Now use HLSL linker).
TODO : Need update glslang/vulkan part for visual studios.sln maybe.

@rcaridade145
Copy link

@GhettoGirl @mrcmunir It would be nice if both your work got into master. I've started implementing Vulkan under Linux https://github.com/rcaridade145/rpcs3/commit/3a4923b9419b288b5da4bcd669ab4328a9ec9a08 and i believe your work would unlock my problems.

@mrcmunir
Copy link

@rcaridade145 Thanks I detected some problem

Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

Won't run on Mate Desktop because they no ported GUI Desktop to GTK3 so maybe broken for Mate desktop.

http://wiki.mate-desktop.org/status:gtk3

@magiruuvelvet
Copy link
Contributor

magiruuvelvet commented Jun 29, 2016

Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

@mrcmunir RPCS3 uses wxWidgets which has several backends (Qt5, GTK2, GTK3, Motif, X11, OpenGL, DirectFB, MS-Windows (windows.h), Wine, Cocoa). There is always the possibility to use another backend for wxWidgets to get rid of such errors, like this one.

OFF TOPIC: I personally prefer Qt5 as backend - I hate GTK so much.

@MrSapps
Copy link

MrSapps commented Jun 29, 2016

Why not just statically link on the problematic platforms?

@rcaridade145
Copy link

@mrcmunir I didn't check yet for different versions of GTK on Ubuntu it is using GTK3 so i concentrated on that first. To get it to work on GTK2 one would need to adapt the code to consider this - http://stackoverflow.com/questions/14788439/getting-x11-window-handle-from-gtkwidget . Then detect on CMakeList the correct GTK or backend of WxWidgets.

@mrcmunir
Copy link

Well I solved that problem force wxwidgets rebuild with gtk3.

./autogen.sh
./configure --prefix=/usr --with-gtk=3 --with-libmspack
make
make -C locale allmo

The main problem is by default wxgtk package under archlinux install with gtk2 and not for gtk3 support.

@orbea
Copy link
Contributor Author

orbea commented Jun 30, 2016

You can always rebuild packages in arch using the PKGBUILD and editing the build flags, wxgtk does not take that long to compile. Personally I like that I can use gtk2 with rpcs3 which supports my theme best.

@mrcmunir
Copy link

Yes I know with https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=wxgtk-git

Change --with-gtk=2 to --with-gtk-3 .

This alternative solution for now because GTK2 and GTK3 linker very problematic and incompatibility.

Well Finish compile with initial vulkan work @rcaridade145 (But untested because intel won't work anyway limited support in the actual state fail createinstance() Undefined trap.

LDR: N3fmt9exceptionE thrown: createInstance(): Undefined trap
(in file /home/mrc/rpcs3/rpcs3/Emu/RSX/VK/VKHelpers.h:1061)

All changes I updated in my repository https://github.com/mrcmunir/rpcs3/ NEED TESTING .

I hope this helps someone to go with vulkan port to linux .

screenshot at 2016-06-30 08 19 03

@rcaridade145
Copy link

Great work @mrcmunir . I'll have sometime this weekend to work on this. However that error can be found in this comment #1736 (comment) . I'll try and make the backend code more resilient so we can use gtk2,gtk3, QT5,etc...

@rcaridade145
Copy link

@magiruuvelvet
Copy link
Contributor

magiruuvelvet commented Jul 11, 2016

@mrcmunir

But untested because intel won't work anyway limited support in the actual state fail createinstance() Undefined trap.

You need Mesa 12 for complete Intel Vulkan support. Also make sure that you enabled the DRI3 option in your Xorg.conf which is a must for Vulkan on Intel to work.

@rcaridade145
Copy link

@mrcmunir @GhettoGirl I worked a bit this weekend on it but all i could get is a blank window..maybe something i'm missing..

@magiruuvelvet
Copy link
Contributor

@rcaridade145 Do you have the DRI3 option enabled in your X server and are you running Mesa 12. Mesa 11 has incomplete Vulkan support on Intel and isn't able to do actual graphics (black screen). Try running some Vulkan samples first.

@mrcmunir
Copy link

@rcaridade145 with that hw running? If you intel HW will needed Gen8 Broadwell GPU and higher Skylake architectures for now under linux because they are missing implementations under Hasswell and Ivy bridge because SIMD running different in that architecture.

For enable DRI3 create file in xorg /etc/X11/xorg.conf.d/20-intel.conf

Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "DRI" "3"
EndSection

@rcaridade145
Copy link

@mrcmunir NVIDIA blob

@mrcmunir
Copy link

In that case it should work correctly NVIDIA vulkan samples running very well under linux

@Nezarn
Copy link

Nezarn commented Jul 11, 2016

@rcaridade145 have you tried building like it was posted on #1752 ?

@rcaridade145
Copy link

@Nezarn i have.

@orbea
Copy link
Contributor Author

orbea commented Feb 17, 2017

Its been a while since I last rebuilt rpcs3 and now that I tried again I can't reproduce these warnings so I am going to close this issue. Thanks!

@sl1pkn07
Copy link
Contributor

this issue appears again

with GCC 8.1 i have this tons of this warnings

cc1plus: warning: /tmp/makepkg/sl1-rpcs3-git/src/build/rpcs3/cotire/rpcs3_CXX_prefix.hxx.gch: not used because `__STDC_CONSTANT_MACROS' is defined [-Winvalid-pch]

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

8 participants