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

Build failure with clang #25

Closed
Biswa96 opened this issue Dec 9, 2021 · 11 comments
Closed

Build failure with clang #25

Biswa96 opened this issue Dec 9, 2021 · 11 comments

Comments

@Biswa96
Copy link
Contributor

Biswa96 commented Dec 9, 2021

  • Build environment - msys2/clang64
  • clang - version 13.0.0 Target: x86_64-w64-windows-gnu
  • Project version - 20211114
  • Build output: build-output.txt

How can I troubleshoot this issue? I can provide any further information if required.

@ctrlcctrlv
Copy link
Member

Build command?

@Biswa96
Copy link
Contributor Author

Biswa96 commented Dec 9, 2021

The build recipe can be found here https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libuninameslist/PKGBUILD. If I resolve all the environment variables in the configure command it will look like this (for clang64):

 ../libuninameslist-20211114/configure \
    --prefix=/clang64 \
    --build=x86_64-w64-mingw32 \
    --host=x86_64-w64-mingw32 \
    --target=x86_64-w64-mingw32 \
    --enable-shared \
    --enable-static

@ctrlcctrlv
Copy link
Member

Thank you. I'm finding it a bit suspicious that on Windows you're providing both --enable-shared and --enable-static? My first thought is it might be related to https://trac.ffmpeg.org/ticket/1968. What if you --disable-shared?

@JoesCat
Copy link
Contributor

JoesCat commented Dec 10, 2021

Hi @Biswa96,
This problem appears to involve the file nameslist-dll.h
The purpose for this file is to advertise only the "public-facing" functions we want to make available, while keeping internal functions private.

I think I recall reading that all windows libraries are dynamic, none are static.
and if we look at this file nameslist-dll.h we probably need to expand the 3rd line to also include 64bit definitions too.

#if defined _WIN32 || defined __CYGWIN__

expand to also include 64bit....

#if defined _WIN32 || defined __CYGWIN__ || defined _WIN64 || defined __CYGWIN64__

borrowing the idea above, after reading...
https://cygwin.com/pipermail/cygwin-developers/2012-July/010732.html

I do not have a windows PC available here for testing this out, can you try testing the code?

@Biswa96
Copy link
Contributor Author

Biswa96 commented Dec 14, 2021

What if you --disable-shared?

Tried that but same error. BTW, we want both static and shared libraries.

expand to also include 64bit....

That does not solve the issue. _WIN32 is defined for both x86 and x86_641

I do not have a windows PC available here for testing this out, can you try testing the code?

If you wish I can ask someone to add msys2 build environment in CI.

Footnotes

  1. https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros

@JoesCat
Copy link
Contributor

JoesCat commented Dec 15, 2021 via email

@JoesCat
Copy link
Contributor

JoesCat commented Dec 22, 2021

Adding the additional || defined _WIN64 || defined __CYGWIN64__ appears to be beneficial. Without it, it did not completely run make check, and with it, it ran all make check successfully.
without WIN64 (test failed)
with WIN64 (test passed)

Might be worth noting.

However, it didn't fix the original problem.... that needs something else...or more

@Biswa96
Copy link
Contributor Author

Biswa96 commented Dec 22, 2021

I can see this in both tests:

# TOTAL: 4
# PASS:  4

What happened is that - By default, GitHub Actions terminates any running jobs if any job in a matrix fails. Here clang64 fails before mingw64. So, GHA terminates mingw64 without finishing it. This message verifies that

Terminate batch job (Y/N)? 

This behavior can be configured with fail-fast: false option.

@JoesCat
Copy link
Contributor

JoesCat commented Dec 22, 2021

Thanks - didn't know that.

@JoesCat
Copy link
Contributor

JoesCat commented Dec 27, 2021

It appears that MSYS2 is quietly injecting it's own copies of the decl import/export definitions. I've turned-off adding that information in file nameslist-dll.h if it sees clang.

Also tested with "./configure --enable-shared --enable-static --enable-frenchlib" and that appeared okay too. I think the problem is resolved and we can close this issue.

@Biswa96
Copy link
Contributor Author

Biswa96 commented Dec 27, 2021

Thank you for fixing this issue.

@Biswa96 Biswa96 closed this as completed Dec 27, 2021
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