mirror of
https://github.com/logos-blockchain/logos-blockchain-circuits.git
synced 2026-05-19 07:49:30 +00:00
wip4
This commit is contained in:
parent
5a8dd7a83d
commit
be17d66f76
10
.github/resources/witness-generator/Makefile
vendored
10
.github/resources/witness-generator/Makefile
vendored
@ -54,8 +54,14 @@ windows-lib: $(LIB)
|
||||
|
||||
# Localizes all circuit-specific code to prevent conflicts when multiple circuit
|
||||
# libraries are linked into the same binary. See CONTRIBUTING.md § "Symbol Isolation".
|
||||
# On Linux/ELF: llvm-objcopy is required — it clears GRP_COMDAT when localizing
|
||||
# COMDAT signature symbols, preventing "relocation refers to symbol in discarded
|
||||
# section" errors that GNU objcopy causes. On Windows/COFF: GNU objcopy suffices
|
||||
# because COFF COMDAT is per-section (not group-based) and is already deduplicated
|
||||
# automatically by the linker — the ELF GRP_COMDAT problem does not apply.
|
||||
PUBLIC_SYMS := $(PROJECT)_generate_witness $(PROJECT)_generate_witness_from_files
|
||||
LOCAL_OBJ := $(PROJECT)_local.o
|
||||
OBJCOPY := $(if $(filter windows,$(OS)),objcopy,llvm-objcopy)
|
||||
|
||||
UNAME := $(shell uname -s)
|
||||
|
||||
@ -65,10 +71,10 @@ $(BIN): $(COMMON_OBJS)
|
||||
|
||||
$(LIB): $(LIB_OBJS)
|
||||
ifeq ($(UNAME),Darwin)
|
||||
ar rcs $@ $^ # On macOS two-level namespace, conflicts don't arise
|
||||
ar rcs $@ $^ # macOS: two-level namespace, conflicts don't arise
|
||||
else
|
||||
ld -r -o $(LOCAL_OBJ) $(filter-out fr.o,$^)
|
||||
llvm-objcopy $(foreach s,$(PUBLIC_SYMS),--keep-global-symbol=$(s)) $(LOCAL_OBJ)
|
||||
$(OBJCOPY) $(foreach s,$(PUBLIC_SYMS),--keep-global-symbol=$(s)) $(LOCAL_OBJ)
|
||||
ar rcs $@ fr.o $(LOCAL_OBJ)
|
||||
rm $(LOCAL_OBJ)
|
||||
endif
|
||||
|
||||
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -655,7 +655,6 @@ jobs:
|
||||
install: >-
|
||||
base-devel
|
||||
mingw-w64-x86_64-toolchain
|
||||
mingw-w64-x86_64-llvm
|
||||
make
|
||||
git
|
||||
|
||||
|
||||
@ -81,6 +81,12 @@ It is safe to deduplicate across circuits — the linker picks one copy, which i
|
||||
On macOS, localization is skipped. macOS uses a two-level namespace by default, meaning symbols are qualified by which
|
||||
library they come from, so the conflict does not arise.
|
||||
|
||||
On Windows, GNU `objcopy` (from MinGW binutils) is used instead of `llvm-objcopy`. `llvm-objcopy --keep-global-symbol`
|
||||
is not supported for COFF objects, but GNU `objcopy --keep-global-symbol` works correctly on COFF — it maps the local
|
||||
binding to COFF storage class `C_STAT`. The ELF `GRP_COMDAT` problem that required `llvm-objcopy` on Linux does not
|
||||
apply on Windows: COFF COMDAT is per-section rather than group-based, and the linker already deduplicates it
|
||||
automatically.
|
||||
|
||||
### Maintenance
|
||||
|
||||
`PUBLIC_SYMS` is hardcoded to `$(PROJECT)_generate_witness` and `$(PROJECT)_generate_witness_from_files` in the
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user