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

Fix builds with GCC on Windows #15

Open
vhotspur opened this issue Apr 3, 2023 · 1 comment
Open

Fix builds with GCC on Windows #15

vhotspur opened this issue Apr 3, 2023 · 1 comment

Comments

@vhotspur
Copy link
Member

vhotspur commented Apr 3, 2023

Using the default Windows configuration for GitHub Actions ends with the following bug:

compile-agent-gcc:
    [apply] D:\a\java-ubench-agent\java-ubench-agent\src\c\events.c: In function 'getter_thread_time':
    [apply] D:\a\java-ubench-agent\java-ubench-agent\src\c\events.c:96:60: warning: unused parameter 'bench' [-Wunused-parameter]
    [apply]    96 | static long long getter_thread_time(const benchmark_run_t *bench, const ubench_event_info_t *UNUSED_PARAMETER(info)) {
    [apply]       |                                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
    [apply] In file included from D:\a\java-ubench-agent\java-ubench-agent\src\c\jnifunc.c:22:
    [apply] D:\a\java-ubench-agent\java-ubench-agent\src\c\jnifunc.c: In function 'Java_cz_cuni_mff_d3s_perf_NativeThreads_getNativeId':
    [apply] D:\a\java-ubench-agent\java-ubench-agent\out\agent/cz_cuni_mff_d3s_perf_NativeThreads.h:11:63: error: invalid suffix "i64" on integer constant
    [apply]    11 | #define cz_cuni_mff_d3s_perf_NativeThreads_INVALID_THREAD_ID -1i64
    [apply]       |                                                               ^~~~
    [apply] D:\a\java-ubench-agent\java-ubench-agent\src\c\jnifunc.c:39:32: note: in expansion of macro 'cz_cuni_mff_d3s_perf_NativeThreads_INVALID_THREAD_ID'
    [apply]    39 |                 return (jlong) cz_cuni_mff_d3s_perf_NativeThreads_INVALID_THREAD_ID;
    [apply]       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Probably caused by javah generating MSVC-specific header as i64 suffix is a non-standard MS extension.

@lbulej
Copy link
Member

lbulej commented Apr 4, 2023

Probably caused by javah generating MSVC-specific header as i64 suffix is a non-standard MS extension.

I observed this recently as well when I was sharing the same development tree between Linux and Windows. Using javah on windows produces such header files, making the agent impossible to compile on linux. ant clean fixed the problem.

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

2 participants