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

Building on Windows in Release mode with official_build=false fails. #3879

Closed
mkarolin opened this issue Mar 25, 2019 · 5 comments
Closed

Building on Windows in Release mode with official_build=false fails. #3879

mkarolin opened this issue Mar 25, 2019 · 5 comments
Assignees

Comments

@mkarolin
Copy link
Contributor

mkarolin commented Mar 25, 2019

After merging C74 into master (#3502) building on Windows in Release mode with official_build=false produces the following link errors:

FAILED: nasm.exe nasm.exe.pdb
ninja -t msvc -e environment.x64 -- ../../third_party/llvm-build/Release+Asserts/bin/lld-link.exe /nologo /OUT:./nasm.exe /PDB:./nasm.exe.pdb @./nasm.exe.rsp
lld-link: error: duplicate symbol: ilog2_32 in obj/third_party/nasm/nasm/directiv.obj and in obj/third_party/nasm/nasm/ilog2.obj
lld-link: error: duplicate symbol: ilog2_64 in obj/third_party/nasm/nasm/directiv.obj and in obj/third_party/nasm/nasm/ilog2.obj
lld-link: error: duplicate symbol: alignlog2_32 in obj/third_party/nasm/nasm/ilog2.obj and in obj/third_party/nasm/nasm/outmacho.obj

cc: @emerick

@mkarolin mkarolin self-assigned this Mar 25, 2019
@mkarolin
Copy link
Contributor Author

  • Both the latest C73 and C74 use the same nasm code (commit 4ee6a69c).
  • The compilation flags for Release mode with official_build=false have not changed (/Od /Ob0 /GF).
  • The Clang version has changed (from 351477 to 354873).

Rolling back to Clang 351477 eliminates the errors.

@mkarolin
Copy link
Contributor Author

mkarolin commented Mar 26, 2019

When linking with /VERBOSE there is a bit more info:
lld-link: conflicting comdat type for ilog2_32: 2 in obj/third_party/nasm/nasm/directiv.obj and 1 in obj/third_party/nasm/nasm/ilog2.obj lld-link: error: duplicate symbol: ilog2_32 in obj/third_party/nasm/nasm/directiv.obj and in obj/third_party/nasm/nasm/ilog2.obj

1 and 2 refer to

enum COMDATType {
    IMAGE_COMDAT_SELECT_NODUPLICATES = 1,
    IMAGE_COMDAT_SELECT_ANY,
    IMAGE_COMDAT_SELECT_SAME_SIZE,
    IMAGE_COMDAT_SELECT_EXACT_MATCH,
    IMAGE_COMDAT_SELECT_ASSOCIATIVE,
    IMAGE_COMDAT_SELECT_LARGEST,
    IMAGE_COMDAT_SELECT_NEWEST
  };

Recent llvm changes of note:

https://reviews.llvm.org/D58180
https://bugs.llvm.org/show_bug.cgi?id=40094 (see all changes at the bottom)

@mkarolin
Copy link
Contributor Author

Also, notice this change in nasm from Nov 2018 where config for windows was switched from config/config-win.h to config/msvc.h (https://chromium.googlesource.com/chromium/deps/nasm.git/+/274b50137b6209b106f8989a24ab92f287654147). Of note in this case is that config-win.h had #define HAVE_STDC_INLINE 1 whereas msvc.h doesn't. This means that on windows none of the functions declared in ilog2.h are inline.

@rebron
Copy link
Collaborator

rebron commented Mar 29, 2019

Closing. Reopen if this happens again.

@rebron rebron closed this as completed Mar 29, 2019
@mkarolin
Copy link
Contributor Author

This will be addressed by #3502 (re-landing of C74 with LLVM reverted to 351477).

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

3 participants