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

compiler fontend failed to generate LLVM bitcode... #163

Closed
SaxonGao-SZ opened this issue Jul 15, 2018 · 9 comments
Closed

compiler fontend failed to generate LLVM bitcode... #163

SaxonGao-SZ opened this issue Jul 15, 2018 · 9 comments

Comments

@SaxonGao-SZ
Copy link

Hello , I try to compile openHEVC source code to *.bc file .

commands :

$ emconfigure cmake -DCMAKE_BUILD_TYPE=Release ..
DEBUG: CMAKE_SYSTEM_PROCESSOR = x86
DEBUG: CMAKE_SYSTEM_NAME      = Emscripten
-- Check size of void*
-- Check size of void* - done
DEBUG: SIZEOF_VOID_P      =
-- target changed from "" to "auto"
-- Detected CPU: generic
-- Performing Test check_cxx_compiler_flag__march_generic
-- Performing Test check_cxx_compiler_flag__march_generic - Failed
-- Performing Test check_cxx_compiler_flag__mno_sse2
-- Performing Test check_cxx_compiler_flag__mno_sse2 - Failed
-- Performing Test check_cxx_compiler_flag__mno_sse3
-- Performing Test check_cxx_compiler_flag__mno_sse3 - Failed
-- Performing Test check_cxx_compiler_flag__mno_ssse3
-- Performing Test check_cxx_compiler_flag__mno_ssse3 - Failed
-- Performing Test check_cxx_compiler_flag__mno_sse4_1
-- Performing Test check_cxx_compiler_flag__mno_sse4_1 - Failed
-- Performing Test check_cxx_compiler_flag__mno_sse4_2
-- Performing Test check_cxx_compiler_flag__mno_sse4_2 - Failed
-- Performing Test check_cxx_compiler_flag__mno_sse4a
-- Performing Test check_cxx_compiler_flag__mno_sse4a - Failed
-- Performing Test check_cxx_compiler_flag__mno_avx
-- Performing Test check_cxx_compiler_flag__mno_avx - Failed
-- Performing Test check_cxx_compiler_flag__mno_xop
-- Performing Test check_cxx_compiler_flag__mno_xop - Failed
-- Performing Test check_cxx_compiler_flag__mno_fma4
-- Performing Test check_cxx_compiler_flag__mno_fma4 - Failed
-- Performing Test check_cxx_compiler_flag__mno_avx2
-- Performing Test check_cxx_compiler_flag__mno_avx2 - Failed
-- Looking for GetProcessAffinityMask
-- Looking for GetProcessAffinityMask - not found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for sched_getaffinity
-- Looking for sched_getaffinity - not found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for usleep
-- Looking for usleep - found
-- Looking for localtime_r
-- Looking for localtime_r - found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file windows.h
-- Looking for include file windows.h - not found
-- Found YASM: /usr/bin/yasm 
-- Found components for YASM
-- YASM_ROOT_DIR  = /usr/local
-- YASM_INCLUDES  = YASM_INCLUDES-NOTFOUND
-- YASM_LIBRARIES = YASM_LIBRARIES-NOTFOUND
-- Performing Test check_c_compiler_flag__fpic
-- Performing Test check_c_compiler_flag__fpic - Success
-- Performing Test check_c_compiler_flag__fno_tree_vectorize
-- Performing Test check_c_compiler_flag__fno_tree_vectorize - Success
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
-- Could NOT find SDL (missing:  SDL_LIBRARY) (found version "1.3.0")
-- Could NOT find SDL2 (missing:  SDL2_LIBRARY SDL2_INCLUDE_DIR)
-- Configuring done
-- Generating done
-- Build files have been written to: /datas/saxongao/dev/openHEVC.wsam/build_wasm
$ emmake make
[  1%] Generating videodsp.o
[  1%] Generating cpuid.o
[  2%] Generating emms.o
[  2%] Generating dct32.o
[  3%] Generating deinterlace.o
[  4%] Generating fft.o
/datas/saxongao/dev/openHEVC.wsam/libavcodec/x86/fft.asm:54: warning: section flags ignored on section redeclaration
[  4%] Generating fpel.o
[  5%] Generating h264_qpel_8bit.o
[  6%] Generating h264_qpel_10bit.o
[  6%] Generating hevc_mc.o
[  7%] Generating hevc_deblock.o
[  7%] Generating hevc_idct.o
[  8%] Generating hpeldsp.o
[  9%] Generating qpel.o
[  9%] Generating qpeldsp.o
Scanning dependencies of target LibOpenHevcWrapper
[ 10%] Building C object CMakeFiles/LibOpenHevcWrapper.dir/libavutil/avstring.c.o
In file included from /datas/saxongao/dev/openHEVC.wsam/libavutil/avstring.c:28:
In file included from /datas/saxongao/dev/openHEVC.wsam/libavutil/common.h:45:
In file included from /datas/saxongao/dev/openHEVC.wsam/libavutil/internal.h:39:
In file included from /datas/saxongao/dev/openHEVC.wsam/libavutil/timer.h:46:
/datas/saxongao/dev/openHEVC.wsam/libavutil/x86/timer.h:34:32: error: invalid output constraint '=a' in asm
    __asm__ volatile("rdtsc" : "=a" (a), "=d" (d));
                               ^
1 error generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
CMakeFiles/LibOpenHevcWrapper.dir/build.make:123: recipe for target 'CMakeFiles/LibOpenHevcWrapper.dir/libavutil/avstring.c.o' failed
make[2]: *** [CMakeFiles/LibOpenHevcWrapper.dir/libavutil/avstring.c.o] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/LibOpenHevcWrapper.dir/all' failed
make[1]: *** [CMakeFiles/LibOpenHevcWrapper.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Waht the problem ? can you help me ?

@kripken
Copy link
Member

kripken commented Jul 16, 2018

emscripten can't compile inline assembly, only portable C/C++.

Perhaps the codebase has a flag to use a generic code path, without inline assembly for a specific CPU.

@SaxonGao-SZ
Copy link
Author

First , thanks for your replay! realy.
You are right , I found ARCH_X86 options in file : openHEVC/platform/x86/config.h.in (line 62):

define ARCH_X86 1

this options will run the YASM codes when compiling. I edited it like this : define ARCH_X86 0 , now This problem was done , but still others~, I will close this issue.
Thanks again!

@kripken
Copy link
Member

kripken commented Jul 18, 2018

Good, glad there was a flag for that!

@kripken kripken closed this as completed Jul 18, 2018
@billy4656515
Copy link

I try to compile OpenHEVC with emscripten too, I end up with a lot of error, how did you do it?

@SaxonGao-SZ
Copy link
Author

SaxonGao-SZ commented Jun 19, 2023 via email

@SaxonGao-SZ
Copy link
Author

SaxonGao-SZ commented Jun 19, 2023 via email

@billy4656515
Copy link

how to do that? on the configuration file (config.h.in line62) I deactivated the use of ARCH_x86 but I find myself with errors :
openHEVC/libavcodec/hevc.c:3264:9: error: call to undeclared function 'ff_hevc_bump_frame'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
3264 | ff_hevc_bump_frame(s);
| ^

@SaxonGao-SZ
Copy link
Author

SaxonGao-SZ commented Jun 19, 2023 via email

@billy4656515
Copy link

the problem is that as soon as I correct an error it becomes a chain reaction and many other errors appear and I don't want to alter the code more than that, there is surely a way to compile OpenhEVC with Emscripten without altering the code too much.

vargaz pushed a commit to vargaz/emsdk that referenced this issue Nov 22, 2023
* Workload changes and arcade update (emscripten-core#171) (emscripten-core#172)

* Update arcade to 7.0.0-beta.22416.1

* Workload changes

Co-authored-by: Larry Ewing <[email protected]>

Co-authored-by: Juan Hoyos <[email protected]>

* [release/7.0-rc1] Make two manifests one for net7 and one for net6 in 7.0.100 sdk band (emscripten-core#163)

* Here goes nothing

* Update WorkloadManifest.json.in

* Update WorkloadManifest.json.in

* Try to fix up the multi-targeted build. This will likely need an arcade change to enable manifests withtout packs and an additional change once arcade is updated.

* Update eng/emsdk.proj

Co-authored-by: Alexander Köplinger <[email protected]>

* Rename .pkgproj files

* Update PackageVersionNet6 to 6.0.9

* Fix the location of the .net7 pkgproj

Co-authored-by: Marc Paine <[email protected]>
Co-authored-by: Ankit Jain <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>

* [release/7.0-rc1] Shorten the name more (emscripten-core#174)

* Shorten the name more

* [release/7.0-rc1] Check nuget sizes and fix them (emscripten-core#175)

* yml: Fail if nuget size exceeds 250MiB, on linux, and macos

* Fix the case for no errors

* Remove unused binaries

Co-authored-by: Ankit Jain <[email protected]>

* Add PowerShell-based NuGet size check script and use it on Windows (emscripten-core#176)

* Add PowerShell-based NuGet size check script and use it on Windows

* Update azure-pipelines.yml

Co-authored-by: Juan Hoyos <[email protected]>
Co-authored-by: Marc Paine <[email protected]>
Co-authored-by: Ankit Jain <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>
vargaz pushed a commit to vargaz/emsdk that referenced this issue Nov 22, 2023
* Workload changes and arcade update (emscripten-core#171) (emscripten-core#172)

* Update arcade to 7.0.0-beta.22416.1

* Workload changes

Co-authored-by: Larry Ewing <[email protected]>

Co-authored-by: Juan Hoyos <[email protected]>

* [release/7.0-rc1] Make two manifests one for net7 and one for net6 in 7.0.100 sdk band (emscripten-core#163)

* Here goes nothing

* Update WorkloadManifest.json.in

* Update WorkloadManifest.json.in

* Try to fix up the multi-targeted build. This will likely need an arcade change to enable manifests withtout packs and an additional change once arcade is updated.

* Update eng/emsdk.proj

Co-authored-by: Alexander Köplinger <[email protected]>

* Rename .pkgproj files

* Update PackageVersionNet6 to 6.0.9

* Fix the location of the .net7 pkgproj

Co-authored-by: Marc Paine <[email protected]>
Co-authored-by: Ankit Jain <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>

* [release/7.0-rc1] Shorten the name more (emscripten-core#174)

* Shorten the name more

* [release/7.0-rc1] Check nuget sizes and fix them (emscripten-core#175)

* yml: Fail if nuget size exceeds 250MiB, on linux, and macos

* Fix the case for no errors

* Remove unused binaries

Co-authored-by: Ankit Jain <[email protected]>

* Add PowerShell-based NuGet size check script and use it on Windows (emscripten-core#176)

* Add PowerShell-based NuGet size check script and use it on Windows

* Update azure-pipelines.yml

* Roll back 6.0.x to 6.0.8 so that packages exist (emscripten-core#177)

* Revert "Roll back 6.0.x to 6.0.8 so that packages exist (emscripten-core#177)" (emscripten-core#178)

This reverts commit b7a5ae2.

* make a 6.0.4 build (emscripten-core#180)

* Revert "make a 6.0.4 build (emscripten-core#180)" (emscripten-core#181)

This reverts commit eb3232e.

* [release/7.0] Update arcade to 7.0.0-beta.22418.4 (emscripten-core#182)

* WorkloadManifest.targets: fix condition (emscripten-core#183)

Co-authored-by: Juan Hoyos <[email protected]>
Co-authored-by: Marc Paine <[email protected]>
Co-authored-by: Ankit Jain <[email protected]>
Co-authored-by: Alexander Köplinger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants