Fix thread safety with LLVM library #340
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Depends on
Reference: M-Labs/nac3#340
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix/llvm-threadsafe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It turns out that although NAC3 uses multiple threads for compilation,
LLVM_ENABLE_THREADS
has been set toOFF
all this time, which may explain all the segfaults and other runtime errors that have been reported.The commit introducing this is from
ffe89eec86
, which explicitly disables threading. I am not sure why it was set that way to begin with, but if that change is necessary for whatever reason, this PR also contains changes to force single-threaded compilation when LLVM detects that thread-safe mode is disabled at build-time.2110638bfe
to71e6fd65ab
71e6fd65ab
toa034844b1a
Fix thread safety with LLVM libraryto WIP: Fix thread safety with LLVM libraryv2: Rebased against master
v3: Rebased against
fix/threading-support
; Add dependency on #341v4: Remove
lazy_static
dependency@ -54,0 +52,4 @@
llvm-link -o module.bc module*.bc main.bc
else
cp main.bc module.bc
fi
How about replacing this entire block of code with something like
llvm-link -o output.bc main.bc module*.bc
?Unfortunately this will cause
llvm-link
to fail withNo such file or directory
.v5: Rebased against
fix/threading-support
557ef1ec79
toc6450befd9
c6450befd9
to25affa332e
v6: Rebased against
fix/threading-support
25affa332e
toeb63698fa5
v6: Rebased against
fix/threading-support
WIP: Fix thread safety with LLVM libraryto Fix thread safety with LLVM libraryeb63698fa5
to73500c9081