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

AppVeyor msys2 build broken #1559

Closed
vincentkfu opened this issue Apr 17, 2023 · 1 comment
Closed

AppVeyor msys2 build broken #1559

vincentkfu opened this issue Apr 17, 2023 · 1 comment

Comments

@vincentkfu
Copy link
Collaborator

AppVeyor recently upgraded their Visual Studio 2019 worker image.

Since the upgrade our Windows build using the msys2 toolchain is broken.

Good build with previous image: https://ci.appveyor.com/project/vincentkfu/fio/builds/46790123/job/lktpna0v91260rko
Bad build with current image: https://ci.appveyor.com/project/vincentkfu/fio/builds/46792337/job/rb3neloe6bn66t0r

Here is the error:

    CC unittests/oslib/strcasestr.o
    CC unittests/oslib/strsep.o
  LINK fio
ld.lld: error: undefined symbol: static_tv_valid
>>> referenced by gettime.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:623: fio] Error 1

The definition of static_tv_valid is guarded by CONFIG_TLS_THREAD and ARCH_HAVE_CPU_CLOCK both of which should be defined for this platform.

For CONFIG_TLS_THREAD we have in the configure output:

socklen_t                     yes
__thread                      yes
RUSAGE_THREAD                 yes

For ARCH_HAVE_CPU_CLOCK we have in arch/arch-x86_64.h:

#define ARCH_HAVE_FFZ
#define ARCH_HAVE_SSE4_2
#define ARCH_HAVE_CPU_CLOCK

A possible cause is the change from clang 15.0.7-3 to 16.0.0-1 in the new worker image, although there is nothing obvious in the clang16 release notes.

vincentkfu added a commit to vincentkfu/fio that referenced this issue Apr 19, 2023
Our Windows msys2 build is now broken after AppVeyor's recent image
update from clang/lld 15.0.7-3 to 16.0.0-1.

Here is the error:

    CC unittests/oslib/strcasestr.o
    CC unittests/oslib/strsep.o
  LINK fio
ld.lld: error: undefined symbol: static_tv_valid
>>> referenced by gettime.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Rishabh Shukla investigated and found that clang + ld builds
successfully. So the problem seems to be with lld 16.0.0-1.

Until we find the root cause let's just disable __thread support on
msys2 builds.

Link: axboe#1559
Suggested-by: Rishabh Shukla <rishabh.sh@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
@vincentkfu
Copy link
Collaborator Author

vincentkfu commented Apr 19, 2023

Rishabh Shukla investigated this and found the following:

  • Using ld instead of lld produces a successful build
  • Using -femulated-tls does not resolve the issue
  • The clang 16 release notes mention a fix for code generation with emulated TLS

lld appears to be the source of the problem but we found no flags or options to get the build working with lld.

Here are three options

  • disable __thread support
  • switch from lld to ld
  • use the previous AppVeyor worker image

Until there is a real fix let us work around this problem by disabling __thread support for AppVeyor msys2 builds.

vincentkfu added a commit to vincentkfu/fio that referenced this issue Apr 19, 2023
Our Windows msys2 build is now broken after AppVeyor's recent image
update from clang/lld 15.0.7-3 to 16.0.0-1.

Here is the error:

    CC unittests/oslib/strcasestr.o
    CC unittests/oslib/strsep.o
  LINK fio
ld.lld: error: undefined symbol: static_tv_valid
>>> referenced by gettime.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Rishabh Shukla investigated and found that clang + ld builds
successfully. So the problem seems to be with lld 16.0.0-1.

Until we find the root cause let's just disable __thread support on
AppVeyor msys2 builds.

Link: axboe#1559
Suggested-by: Rishabh Shukla <rishabh.sh@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
vincentkfu added a commit to vincentkfu/fio that referenced this issue Apr 20, 2023
Our Windows msys2 build is now broken after AppVeyor's recent image
update from clang/lld 15.0.7-3 to 16.0.0-1.

Here is the error:

    CC unittests/oslib/strcasestr.o
    CC unittests/oslib/strsep.o
  LINK fio
ld.lld: error: undefined symbol: static_tv_valid
>>> referenced by gettime.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Rishabh Shukla investigated and found that clang + ld builds
successfully. So the problem seems to be with lld 16.0.0-1.

Until we find the root cause let's just disable __thread support on
AppVeyor msys2 builds.

Link: axboe#1559
Suggested-by: Rishabh Shukla <rishabh.sh@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
@vincentkfu vincentkfu closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2023
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

1 participant