Skip to content

Pth not supported #4086

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
Maeiky opened this issue Feb 10, 2016 · 14 comments
Closed

Pth not supported #4086

Maeiky opened this issue Feb 10, 2016 · 14 comments

Comments

@Maeiky
Copy link

Maeiky commented Feb 10, 2016

Include a precompiled header file not work in emscripten :

Generate Pch:
-std=c++11 -m32 -fno-exceptions -O2 -x c++-header xxx.h -o xxx.pch

Compile Obj:
-std=c++11 -m32 -fno-exceptions -O2 -c xxx.cpp -include-pch xxx.pch -o xxx.o

I have this error :
ERROR:root:xxx.pch: Input file has an unknown suffix, don't know what to do with it!

@kripken
Copy link
Member

kripken commented Feb 10, 2016

emcc supports precompiled headers with suffix gch, which I thought was the standard gcc suffix, but that might have been wrong?

@Maeiky
Copy link
Author

Maeiky commented Feb 10, 2016

Same error with gch,
gch is for GCC, but emscripten is based on Clang!?

http://clang.llvm.org/docs/UsersManual.html

generate a PCH file using Clang, one invokes Clang with the -x -header option. This mirrors the interface in GCC for generating PCH files:
$ gcc -x c-header test.h -o test.h.gch
$ clang -x c-header test.h -o test.h.pch

http://clang.llvm.org/docs/PCHInternals.html
http://clang.llvm.org/docs/PTHInternals.html

kripken added a commit that referenced this issue Feb 18, 2016
@kripken
Copy link
Member

kripken commented Feb 18, 2016

gch is still the default clang emits, if you run clang -x c-header test.h -c (i.e. if you don't tell it the output name).

Looking into this more carefully, the core issue is that we didn't recognize the -include-pch argument. Added support for that, and verified it works with both gch and pch.

@kripken kripken closed this as completed Feb 18, 2016
@kripken
Copy link
Member

kripken commented Feb 18, 2016

The one thing I didn't do is anything with pth files - is that important as well?

@Maeiky
Copy link
Author

Maeiky commented Feb 21, 2016

Yes, for future versions of Clang> = 3.9. This will provide a more flexible precompilation of headers.
Thanks

@kripken kripken changed the title Pch / Pth not supported Pth not supported Feb 21, 2016
@kripken
Copy link
Member

kripken commented Feb 21, 2016

Ok, reopening for pth.

@kripken kripken reopened this Feb 21, 2016
kripken added a commit that referenced this issue Feb 24, 2016
@froydnj
Copy link
Contributor

froydnj commented Feb 6, 2018

I don't know if PTH files are worth supporting. The official clang user's manual doesn't mention PTH files at all, preferring to focus on PCH files instead. (PTH files are mentioned in the in design documents, but nowhere else AFAICS.) The clang driver doesn't recognize -include-pth; that's a cc1 option, so you need to pass it down with -Xclang...but that confuses emcc's extraction of input files. WDYT, @kripken, should we just close this?

@kripken
Copy link
Member

kripken commented Feb 7, 2018

Sounds reasonable to close, yeah.

@kripken kripken closed this as completed Feb 7, 2018
@pouyarb
Copy link

pouyarb commented Jun 28, 2023

hello
built with qmake and mingw 13:
emcc -c -Xclang -include-pch -Xclang wasm\z_token_wasm.js.pch\c.pch -std=c11 -O2 -Wall -Wextra -s ALLOW_MEMORY_GROWTH=1 -Dzf_using_z_token_v4 -Dzf_e_core -Dzf_use_pana_keya -Dzf_using_z_token_v4 -Dzf_using_cipher_lib_v6 -Dzf_custom_hash_exists -Dzf_using_z_token_v4 -DZ_32 -DZ_LIN -D__UNIX__ -Dzf_use_epass -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I..\z_tokensrc -I. -I....\include -IC:\boost\boost_1_80_0 -I/home/boost/boost_1_80_0/ -I. -I./../Source_other/lib/panakey -IC:\Qt\Qt5.15\5.15.2\wasm_32\include -IC:\Qt\Qt5.15\5.15.2\wasm_32\include\QtNetwork -IC:\Qt\Qt5.15\5.15.2\wasm_32\include\QtCore -I/.emscripten_ports/openssl/include -IC:\Qt\Qt5.15\5.15.2\wasm_32\mkspecs\wasm-emscripten -o wasm\global.obj ..\z_tokensrc\unimate\global.c

i have error:
shared:ERROR: wasm\z_token_wasm.js.pch\c.pch: Input file has an unknown suffix, don't know what to do with it!

@sbc100
Copy link
Collaborator

sbc100 commented Jun 28, 2023

@pouyarb what version of emscripten are you using? The error message you getting looks like it was removed in #10560 (2020).. but the way the error is presented (with shared:ERROR at the start) make it look like this version goes back to before 2017. That error reporting for that message back in #5710 (2017).. so it looks like you are using 1.37.23 or older?

@pouyarb
Copy link

pouyarb commented Jun 29, 2023

Im using version 1.39.7 due to qt requirements. I can not update emscripten

@sbc100
Copy link
Collaborator

sbc100 commented Jun 29, 2023

In that case maybe you could petition the qt folks to update their emscripten requirements, since this issue has already been fixed on the emscripten side.

@pouyarb
Copy link

pouyarb commented Jun 29, 2023

thank you for your help. could you tell me which commit have fixed this issue?

@sbc100
Copy link
Collaborator

sbc100 commented Jun 29, 2023

#10560 looks like a likely candidate since it removes the error in question. For that you would need version 1.40.1 or above. But honestly I wouldn't recommend upgrading to anything other than the very latest release (3.1.42).

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

5 participants