mstorsjo (Martin Storsjö)
User

Projects

User does not belong to any projects.

User Details

User Since
Jul 25 2016, 12:54 PM (64 w, 4 h)

Recent Activity

Today

mstorsjo added a comment to D38972: Add the /v option which prints out the LLD version string..

FWIW, I've got code elsewhere that detects lld-link, that looks like this:

Mon, Oct 16, 2:20 PM
mstorsjo updated the diff for D38937: [LLD] [COFF] Exclude certain static libraries and object files when exporting all symbols.

Wrap up all the sets and logic for deciding what symbols to export into a class.

Mon, Oct 16, 12:09 AM
mstorsjo added a comment to D38937: [LLD] [COFF] Exclude certain static libraries and object files when exporting all symbols.
In D38937#898216, @ruiu wrote:
In D38937#898214, @ruiu wrote:

At this point I feel like we should define a function bool shouldExport(Defined *Sym) or something, so that we can move the code to that function.

Sounds like a good idea. How do you suggest to handle the exclude StringSets in that case - recreate them in each function invocation? Or have a static StringSet<> ExcludeSymbols in the global scope?

I don't know if this is a good idea, but since the number of strings you need to check is small, you may be able to just iterate over the list like this?

for (StringRef S : {"libgcc", "libgcc_s", ...})
  if (LibName == S)
    return false;
Mon, Oct 16, 12:07 AM

Yesterday

mstorsjo added a comment to D38937: [LLD] [COFF] Exclude certain static libraries and object files when exporting all symbols.
In D38937#898214, @ruiu wrote:

At this point I feel like we should define a function bool shouldExport(Defined *Sym) or something, so that we can move the code to that function.

Sun, Oct 15, 2:24 PM
mstorsjo created D38937: [LLD] [COFF] Exclude certain static libraries and object files when exporting all symbols.
Sun, Oct 15, 2:11 PM
mstorsjo committed rL315879: [COFF] Fix indentation. NFC..
[COFF] Fix indentation. NFC.
Sun, Oct 15, 2:10 PM
mstorsjo committed rL315880: [COFF] Fix a typo in a comment in a test. NFC..
[COFF] Fix a typo in a comment in a test. NFC.
Sun, Oct 15, 2:10 PM
mstorsjo committed rL315878: [COFF] Fix the description of the data type in a comment. NFC..
[COFF] Fix the description of the data type in a comment. NFC.
Sun, Oct 15, 2:09 PM
mstorsjo updated the diff for D38704: [libunwind] Abstract rwlocks into a class, provide a SRW lock implementation for windows.

Instead of trying to emulate the pthread rwlocks api with windows implementations, add a RWMutex class (with an interface similar to SmartRWMutex from LLVM) with inline implementations, which can either be no-ops (for no-threads configurations), implemented with SRW locks for windows or pthreads.

Sun, Oct 15, 12:50 PM
mstorsjo added inline comments to D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64.
Sun, Oct 15, 10:54 AM
mstorsjo added a comment to D38704: [libunwind] Abstract rwlocks into a class, provide a SRW lock implementation for windows.

I don't think we should depend on LLVM for the locking stuff. This sort of infrastructure is in the same bucket as the demangler which we haven't really solved.

I *do* find it weird to do it this way though. I think you should have some mutex functions which include read/write unlock. This way you don't need the weird state.

Sun, Oct 15, 3:48 AM
mstorsjo updated the diff for D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64.

Use __SIZEOF_POINTER__ instead of checking __LP64__ together with _WIN64. Changed _WIN32 into _WIN64 within the assembly sources for consistency/clarity. Removed one type definition ifdef by just using (u)intptr_t instead.

Sun, Oct 15, 3:47 AM
mstorsjo added inline comments to D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64.
Sun, Oct 15, 3:34 AM

Sat, Oct 14

mstorsjo added a comment to D38704: [libunwind] Abstract rwlocks into a class, provide a SRW lock implementation for windows.

I'm a little nervous about re-inventing a poor man's version of a reader writer lock. Can we not just copy LLVM's?

Sat, Oct 14, 2:08 PM
mstorsjo accepted D38900: libunwind: document tested FreeBSD configs and sort OS list.

Seems ok to me, with whatever other architectures it's verified on as well.

Sat, Oct 14, 9:12 AM

Thu, Oct 12

mstorsjo added a comment to D38530: [AArch64] Add support for dllimport of values and functions.

Ping

Thu, Oct 12, 2:12 PM
mstorsjo added a comment to D36111: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb.

This one can be abandoned now.

Thu, Oct 12, 2:11 PM
mstorsjo added a comment to D38513: [LLD] [RFC] [COFF] Add support for GNU binutils import libraries.

My hypothesis is that link might special-case zero-sized sections, but I have no evidence to back that up yet.

Thu, Oct 12, 11:43 AM
mstorsjo committed rL315567: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb.
[COFF, ARM64] Add MS builtins __dmb, __dsb, __isb
Thu, Oct 12, 12:05 AM
mstorsjo closed D38821: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb by committing rL315567: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb.
Thu, Oct 12, 12:05 AM
mstorsjo added a comment to D38821: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb.

Don't you need a change to the intrinsics to actually map the builtin?

Thu, Oct 12, 12:00 AM

Wed, Oct 11

mstorsjo added a comment to D38513: [LLD] [RFC] [COFF] Add support for GNU binutils import libraries.

Could you elaborate on "the first object file in the static import library to be included is the function itself"? Is the function in question the linker-provided import thunk, or something else?

Wed, Oct 11, 11:27 PM
mstorsjo committed rL315563: [MinGW] Hook up the --export-all-symbols and --output-def options.
[MinGW] Hook up the --export-all-symbols and --output-def options
Wed, Oct 11, 10:37 PM
mstorsjo committed rL315562: [COFF] Add support for automatically exporting all symbols.
[COFF] Add support for automatically exporting all symbols
Wed, Oct 11, 10:37 PM
mstorsjo closed D38761: [LLD] [MinGW] Hook up the --export-all-symbols and -output-def options by committing rL315563: [MinGW] Hook up the --export-all-symbols and --output-def options.
Wed, Oct 11, 10:37 PM
mstorsjo committed rL315561: [COFF] Implement support for IMAGE_REL_ARM64_ADDR32NB.
[COFF] Implement support for IMAGE_REL_ARM64_ADDR32NB
Wed, Oct 11, 10:37 PM
mstorsjo closed D38760: [LLD] [COFF] Add support for automatically exporting all symbols by committing rL315562: [COFF] Add support for automatically exporting all symbols.
Wed, Oct 11, 10:37 PM
mstorsjo closed D38815: [LLD] [COFF] Implement support for IMAGE_REL_ARM64_ADDR32NB by committing rL315561: [COFF] Implement support for IMAGE_REL_ARM64_ADDR32NB.
Wed, Oct 11, 10:37 PM
mstorsjo added a comment to D38821: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb.

Don't you need a change to the intrinsics to actually map the builtin?

Wed, Oct 11, 9:48 PM
mstorsjo added inline comments to D38680: [libunwind] Fix handling of DW_CFA_GNU_args_size.
Wed, Oct 11, 9:45 PM
mstorsjo created D38821: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb.
Wed, Oct 11, 2:09 PM
mstorsjo added a comment to D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64.

As further explanation/justification - libcxxabi and libunwind don't support SEH exceptions yet.

Wed, Oct 11, 1:45 PM
mstorsjo created D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64.
Wed, Oct 11, 1:15 PM
mstorsjo committed rL315498: Support DWARF unwinding on i386 windows.
Support DWARF unwinding on i386 windows
Wed, Oct 11, 1:06 PM
mstorsjo closed D38679: [libunwind] Support dwarf unwinding on i386 windows by committing rL315498: Support DWARF unwinding on i386 windows.
Wed, Oct 11, 1:06 PM
mstorsjo committed rL315497: [docs] Mention that linux/arm64 is supported with DWARF.
[docs] Mention that linux/arm64 is supported with DWARF
Wed, Oct 11, 1:06 PM
mstorsjo added a comment to D36111: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb.

Sorry, I never got to complete this as I moved to other priorities. I do not think I have cycles to do this now. Please feel free to take over this patch :)

Wed, Oct 11, 12:51 PM
mstorsjo updated the diff for D38760: [LLD] [COFF] Add support for automatically exporting all symbols.

Constructing the exclude string sets directly instead of doing string transformations.

Wed, Oct 11, 12:49 PM
mstorsjo added a comment to D38760: [LLD] [COFF] Add support for automatically exporting all symbols.
In D38760#895075, @ruiu wrote:

By the way, why does GNU ld export all symbols by default? Is it to emulate the ELF-ism on Windows?

Wed, Oct 11, 12:35 PM
mstorsjo added a comment to D38679: [libunwind] Support dwarf unwinding on i386 windows.

LGTM

Wed, Oct 11, 12:31 PM
mstorsjo updated the diff for D38760: [LLD] [COFF] Add support for automatically exporting all symbols.

Added more comments about this being mingw specific, changed to use a StringSet instead of a sorted vector.

Wed, Oct 11, 12:29 PM
mstorsjo added inline comments to D38815: [LLD] [COFF] Implement support for IMAGE_REL_ARM64_ADDR32NB.
Wed, Oct 11, 12:15 PM
mstorsjo created D38815: [LLD] [COFF] Implement support for IMAGE_REL_ARM64_ADDR32NB.
Wed, Oct 11, 11:51 AM
mstorsjo added a comment to D36111: [COFF, ARM64] Add MS builtins __dmb, __dsb, __isb.

@mgrang, did you ever get to completing this? I've got a need for this now (only __dmb so far), and if you don't have time, I can try to finish it.

Wed, Oct 11, 6:01 AM
mstorsjo added a comment to D38760: [LLD] [COFF] Add support for automatically exporting all symbols.

Isn't there a hard limit on the number of files that can be exported in COFF?

Wed, Oct 11, 5:51 AM
mstorsjo updated the diff for D38760: [LLD] [COFF] Add support for automatically exporting all symbols.

Print DATA in the output def for data symbols, adjusted the stdcall decoration for DllEntryPoint.

Wed, Oct 11, 3:33 AM
mstorsjo updated the diff for D38760: [LLD] [COFF] Add support for automatically exporting all symbols.

Changed the exclude list as suggested by Zachary (write all entries in fully decorated form and just substr the others), moved it to a separate function and using std::sort and std::binary_search instead of making a set of it. Added a comment and changed a condition into an early return, as suggested by Rui.

Wed, Oct 11, 1:17 AM
mstorsjo added inline comments to D38760: [LLD] [COFF] Add support for automatically exporting all symbols.
Wed, Oct 11, 1:15 AM

Tue, Oct 10

mstorsjo added a comment to D38679: [libunwind] Support dwarf unwinding on i386 windows.

Are there any further comments on this, or can someone of those who commented on it before approve it?

Tue, Oct 10, 9:58 PM
mstorsjo added a comment to D38760: [LLD] [COFF] Add support for automatically exporting all symbols.

Thanks for the review - one inline response to a comment, will do the other suggested changes tomorrow.

Tue, Oct 10, 2:27 PM
mstorsjo created D38761: [LLD] [MinGW] Hook up the --export-all-symbols and -output-def options.
Tue, Oct 10, 1:48 PM
mstorsjo created D38760: [LLD] [COFF] Add support for automatically exporting all symbols.
Tue, Oct 10, 1:47 PM
mstorsjo added a comment to D38128: Handle COPYs of physregs better (regalloc hints).

Thanks Martin - test case updated.

Tue, Oct 10, 5:12 AM
mstorsjo added a comment to D38128: Handle COPYs of physregs better (regalloc hints).

I checked the test that I had written (CodeGen/AArch64/win64_vararg.ll) and found one issue.

Tue, Oct 10, 4:41 AM

Mon, Oct 9

mstorsjo committed rL315273: [COFF] Don't error out on relocations to discarded sections in .eh_frame.
[COFF] Don't error out on relocations to discarded sections in .eh_frame
Mon, Oct 9, 11:05 PM
mstorsjo closed D38681: [LLD] [COFF] Don't error out on relocations to discarded sections in .eh_frame by committing rL315273: [COFF] Don't error out on relocations to discarded sections in .eh_frame.
Mon, Oct 9, 11:05 PM
mstorsjo added a comment to D38680: [libunwind] Fix handling of DW_CFA_GNU_args_size.

I think that the problem is that we are using the generic register name, but we need to use the target specific register name. On x86, EIP/ESP are swapped.

Mon, Oct 9, 2:24 PM
mstorsjo added a comment to D38704: [libunwind] Abstract rwlocks into a class, provide a SRW lock implementation for windows.

I'm a little nervous about re-inventing a poor man's version of a reader writer lock. Can we not just copy LLVM's?

Mon, Oct 9, 2:19 PM
mstorsjo created D38704: [libunwind] Abstract rwlocks into a class, provide a SRW lock implementation for windows.
Mon, Oct 9, 1:32 PM
mstorsjo updated the diff for D38681: [LLD] [COFF] Don't error out on relocations to discarded sections in .eh_frame.

Changed the section name comparison to ==.

Mon, Oct 9, 1:26 PM
mstorsjo added inline comments to D38681: [LLD] [COFF] Don't error out on relocations to discarded sections in .eh_frame.
Mon, Oct 9, 1:25 PM
mstorsjo added inline comments to D38679: [libunwind] Support dwarf unwinding on i386 windows.
Mon, Oct 9, 1:19 PM
mstorsjo updated the diff for D38679: [libunwind] Support dwarf unwinding on i386 windows.

Added a fixme comment about the truncated section name, flipped the ifdef in the assembly source. Didn't implement findFunctionName.

Mon, Oct 9, 1:18 PM
mstorsjo added inline comments to D38679: [libunwind] Support dwarf unwinding on i386 windows.
Mon, Oct 9, 1:15 PM
mstorsjo added inline comments to D38679: [libunwind] Support dwarf unwinding on i386 windows.
Mon, Oct 9, 12:32 PM
mstorsjo added inline comments to D38679: [libunwind] Support dwarf unwinding on i386 windows.
Mon, Oct 9, 12:09 PM
mstorsjo updated the diff for D38681: [LLD] [COFF] Don't error out on relocations to discarded sections in .eh_frame.

Updated a comment together in sync with the updated code.

Mon, Oct 9, 2:30 AM
mstorsjo created D38681: [LLD] [COFF] Don't error out on relocations to discarded sections in .eh_frame.
Mon, Oct 9, 2:27 AM
mstorsjo created D38680: [libunwind] Fix handling of DW_CFA_GNU_args_size.
Mon, Oct 9, 2:15 AM
mstorsjo created D38679: [libunwind] Support dwarf unwinding on i386 windows.
Mon, Oct 9, 2:05 AM

Fri, Oct 6

mstorsjo closed D38532: [X86] Update an outdated comment about SjLj. NFC. by committing rL315146: [X86] Update an outdated comment about SjLj.
Fri, Oct 6, 11:02 PM
mstorsjo committed rL315146: [X86] Update an outdated comment about SjLj.
[X86] Update an outdated comment about SjLj
Fri, Oct 6, 11:02 PM
mstorsjo committed rL315090: [docs] Mention that SjLj works on any OS on the archs where supported by the….
[docs] Mention that SjLj works on any OS on the archs where supported by the…
Fri, Oct 6, 12:15 PM
mstorsjo closed D38576: |libunwind] [docs] Mention that SjLj works on any OS on the archs where supported by the compiler by committing rL315090: [docs] Mention that SjLj works on any OS on the archs where supported by the….
Fri, Oct 6, 12:15 PM
mstorsjo updated the diff for D38532: [X86] Update an outdated comment about SjLj. NFC..

Updated the comment as requested.

Fri, Oct 6, 9:47 AM

Wed, Oct 4

mstorsjo created D38576: |libunwind] [docs] Mention that SjLj works on any OS on the archs where supported by the compiler.
Wed, Oct 4, 11:24 PM
mstorsjo added a reviewer for D38530: [AArch64] Add support for dllimport of values and functions: mgrang.
Wed, Oct 4, 12:37 PM
mstorsjo created D38532: [X86] Update an outdated comment about SjLj. NFC..
Wed, Oct 4, 1:57 AM
mstorsjo created D38530: [AArch64] Add support for dllimport of values and functions.
Wed, Oct 4, 1:18 AM
mstorsjo added a comment to D33601: libunwind: fix building on mingw-w64.

@martell I think this patch can be discarded now. The CMake parts for mingw libs have been committed, and libunwind works for SjLj exceptions on mingw on x86, x86_64 and armv7 now (although only for static builds).

Wed, Oct 4, 1:13 AM

Tue, Oct 3

mstorsjo committed rL314876: [X86] Fix using the SJLJ jump table on x86_64.
[X86] Fix using the SJLJ jump table on x86_64
Tue, Oct 3, 10:14 PM
mstorsjo closed D38333: [X86] Fix using the SJLJ jump table on x86_64 by committing rL314876: [X86] Fix using the SJLJ jump table on x86_64.
Tue, Oct 3, 10:13 PM
mstorsjo added a comment to D38513: [LLD] [RFC] [COFF] Add support for GNU binutils import libraries.
In D38513#887477, @ruiu wrote:

Import library files are tricky, and I don't fully understand how it works in the MSVC linker. It seems that because import libraries contain sections such as .idata$2, .idata$3, etc., they would be "naturally" processed and sorted in the MSVC linker, and as a result a correct output would be created. But I couldn't figure that out. So, lld implements a special logic for the import library.

Tue, Oct 3, 1:54 PM
mstorsjo created D38513: [LLD] [RFC] [COFF] Add support for GNU binutils import libraries.
Tue, Oct 3, 1:25 PM

Mon, Oct 2

mstorsjo committed rL314767: [X86] Provide the LSDA pointer with RIP relative addressing if necessary.
[X86] Provide the LSDA pointer with RIP relative addressing if necessary
Mon, Oct 2, 11:31 PM
mstorsjo closed D38343: [X86] Provide the LSDA pointer with RIP relative addressing if necessary by committing rL314767: [X86] Provide the LSDA pointer with RIP relative addressing if necessary.
Mon, Oct 2, 11:31 PM
mstorsjo updated the diff for D38333: [X86] Fix using the SJLJ jump table on x86_64.

Changed the if to a switch, added comments about what instructions are supposed to be generated, removed the superfluous conditional in the 32 bit codepath, expanded the test for x86_64 linux, renamed register variables as suggested (and renamed Base into BReg).

Mon, Oct 2, 11:19 PM
mstorsjo added inline comments to D38333: [X86] Fix using the SJLJ jump table on x86_64.
Mon, Oct 2, 11:13 PM
mstorsjo committed rL314716: Add CMake support for building for MinGW.
Add CMake support for building for MinGW
Mon, Oct 2, 1:48 PM
mstorsjo closed D38380: [libunwind] Add CMake support for building for MinGW by committing rL314716: Add CMake support for building for MinGW.
Mon, Oct 2, 1:48 PM
mstorsjo committed rL314695: Fix building on macOS after SVN r314492.
Fix building on macOS after SVN r314492
Mon, Oct 2, 11:15 AM

Sun, Oct 1

mstorsjo updated the diff for D38343: [X86] Provide the LSDA pointer with RIP relative addressing if necessary.

Simplified by making the enclosing function a member function to allow it using getGlobalWrapperKind instead.

Sun, Oct 1, 10:28 PM
mstorsjo added inline comments to D38343: [X86] Provide the LSDA pointer with RIP relative addressing if necessary.
Sun, Oct 1, 10:27 PM
mstorsjo abandoned D38250: [libunwind] Implement the Get/SetTopOfFunctionStack functions via a __thread TLS variable.

Works fine with the version from r314632 (with a minor fixup in r314635).

Sun, Oct 1, 1:26 PM
mstorsjo committed rL314635: SjLj: Fix building after SVN r314632.
SjLj: Fix building after SVN r314632
Sun, Oct 1, 1:24 PM
mstorsjo added inline comments to D38250: [libunwind] Implement the Get/SetTopOfFunctionStack functions via a __thread TLS variable.
Sun, Oct 1, 1:07 PM

Fri, Sep 29

mstorsjo updated the diff for D38333: [X86] Fix using the SJLJ jump table on x86_64.

Also get rid of some of the errors with -verify-machineinstrs.

Fri, Sep 29, 5:05 AM
mstorsjo updated the diff for D38333: [X86] Fix using the SJLJ jump table on x86_64.

Fixed the issues in unoptimized builds; it took some time to figure out that I couldn't use TargetOpcode::COPY to zero-extend a 32 bit register into 64 bit, but had to use TargetOpcode::SUBREG_TO_REG. Also now using more virtual registers for each intermediate value instead of reusing them - this seemed to produce more sensible annotated output from different register allocators (and doesn't matter when using optimizations properly). But if you prefer, I can reduce it down to just using as many virtual registers as before.

Fri, Sep 29, 4:56 AM

Thu, Sep 28

mstorsjo committed rL314492: Skip building x86 parts of UnwindRegisters*.S when targeting SjLj.
Skip building x86 parts of UnwindRegisters*.S when targeting SjLj
Thu, Sep 28, 11:11 PM
mstorsjo closed D38381: [libunwind] Skip building x86 parts of UnwindRegisters*.S when targeting SjLj by committing rL314492: Skip building x86 parts of UnwindRegisters*.S when targeting SjLj.
Thu, Sep 28, 11:10 PM