File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ Options:
6969 -n, --nice Nice all jobs. Use all cpus unless --threads is
7070 also given, then use N threads.
7171
72- --yosys-args-overwrite Do not use default flags set by this scrip during
72+ --yosys-args-overwrite Do not use default flags set by this script during
7373 Yosys compilation.
7474
7575 --yosys-args STRING Additional compilation flags for Yosys compilation.
@@ -78,7 +78,7 @@ Options:
7878 to the Verific source folder.
7979
8080 --openroad-args-overwrite
81- Do not use default flags set by this scrip during
81+ Do not use default flags set by this script during
8282 OpenROAD app compilation.
8383
8484 --openroad-args STRING Additional compilation flags for OpenROAD app
Original file line number Diff line number Diff line change @@ -15,15 +15,9 @@ COPY --link build_openroad.sh build_openroad.sh
1515
1616FROM orfs-base AS orfs-builder-base
1717
18- # Inject compiler wrapper scripts that append the macros
19- RUN mkdir -p /usr /local /bin /wrapped -cc && \
20- echo '#!/bin/sh' > /usr/local /bin /wrapped -cc /gcc && \
21- echo 'exec /usr/bin/gcc -D__TIME__="\"0\"" -D__DATE__="\"0\"" -D__TIMESTAMP__="\"0\"" -Wno-builtin-macro-redefined "$@"' >> /usr/local /bin /wrapped -cc /gcc && \
22- chmod +x /usr /local /bin /wrapped -cc /gcc && \
23- ln -sf /usr /local /bin /wrapped -cc /gcc /usr /local /bin /wrapped -cc /cc && \
24- echo '#!/bin/sh' > /usr/local /bin /wrapped -cc /g ++ && \
25- echo 'exec /usr/bin/g++ -D__TIME__="\"0\"" -D__DATE__="\"0\"" -D__TIMESTAMP__="\"0\"" -Wno-builtin-macro-redefined "$@"' >> /usr/local /bin /wrapped -cc /g ++ && \
26- chmod +x /usr /local /bin /wrapped -cc /g ++
18+ # Add compiler wrapper scripts for reproducible builds
19+ COPY --link etc/setup _compiler_wrappers . sh /tmp/
20+ RUN sh /tmp/setup _compiler_wrappers . sh && rm /tmp /setup_compiler_wrappers . sh
2721
2822# Prepend wrapper directory to PATH so they override system compilers
2923ENV PATH = "/usr/local/bin/wrapped-cc:$PATH"
Original file line number Diff line number Diff line change @@ -15,16 +15,9 @@ COPY InstallerOpenROAD.sh \
1515ARG options=""
1616ARG constantBuildDir="-constant-build-dir"
1717
18- # add compiler wrapper scripts
19- # inject the macro definitions during compilation only
20- RUN mkdir -p /usr/local/bin/wrapped-cc && \
21- echo '#!/bin/sh' > /usr/local/bin/wrapped-cc/gcc && \
22- echo 'exec /usr/bin/gcc -D__TIME__="\"0\"" -D__DATE__="\"0\"" -D__TIMESTAMP__="\"0\"" -Wno-builtin-macro-redefined "$@"' >> /usr/local/bin/wrapped-cc/gcc && \
23- chmod +x /usr/local/bin/wrapped-cc/gcc && \
24- ln -sf /usr/local/bin/wrapped-cc/gcc /usr/local/bin/wrapped-cc/cc && \
25- echo '#!/bin/sh' > /usr/local/bin/wrapped-cc/g++ && \
26- echo 'exec /usr/bin/g++ -D__TIME__="\"0\"" -D__DATE__="\"0\"" -D__TIMESTAMP__="\"0\"" -Wno-builtin-macro-redefined "$@"' >> /usr/local/bin/wrapped-cc/g++ && \
27- chmod +x /usr/local/bin/wrapped-cc/g++
18+ # add compiler wrapper scripts for reproducible builds
19+ COPY setup_compiler_wrappers.sh /tmp/
20+ RUN sh /tmp/setup_compiler_wrappers.sh && rm /tmp/setup_compiler_wrappers.sh
2821
2922ENV PATH="/usr/local/bin/wrapped-cc:$PATH"
3023
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # setup_compiler_wrappers.sh
3+ # Creates compiler wrapper scripts for reproducible builds by overriding
4+ # __TIME__, __DATE__, and __TIMESTAMP__ macros with constant values.
5+ # This ensures Docker image builds are deterministic regardless of build time.
6+
7+ set -e
8+
9+ WRAPPER_DIR=" /usr/local/bin/wrapped-cc"
10+ mkdir -p " $WRAPPER_DIR "
11+
12+ # GCC wrapper
13+ cat > " $WRAPPER_DIR /gcc" << 'WRAPPER '
14+ #!/bin/sh
15+ exec /usr/bin/gcc -D__TIME__="\"0\"" -D__DATE__="\"0\"" -D__TIMESTAMP__="\"0\"" -Wno-builtin-macro-redefined "$@"
16+ WRAPPER
17+ chmod +x " $WRAPPER_DIR /gcc"
18+
19+ # Symlink cc to gcc wrapper
20+ ln -sf " $WRAPPER_DIR /gcc" " $WRAPPER_DIR /cc"
21+
22+ # G++ wrapper
23+ cat > " $WRAPPER_DIR /g++" << 'WRAPPER '
24+ #!/bin/sh
25+ exec /usr/bin/g++ -D__TIME__="\"0\"" -D__DATE__="\"0\"" -D__TIMESTAMP__="\"0\"" -Wno-builtin-macro-redefined "$@"
26+ WRAPPER
27+ chmod +x " $WRAPPER_DIR /g++"
You can’t perform that action at this time.
0 commit comments