File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,23 @@ 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  -s  /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 ++
27+ 
28+ # Prepend wrapper directory to PATH so they override system compilers 
29+ ENV  PATH = "/usr/local/bin/wrapped-cc:$PATH" 
30+ 
1831COPY  --link  tools  tools 
1932ARG  numThreads = $( nproc ) 
2033
2134RUN  echo  ""  > tools /yosys /abc /. gitcommit  && \
22-   env  CFLAGS = "-Wno-builtin-macro-redefined"  \
23-   CXXFLAGS = "-Wno-builtin-macro-redefined"  \
2435  . /build_openroad . sh  --no_init  --local  --threads  ${ numThreads } 
2536
2637FROM  orfs -base 
Original file line number Diff line number Diff line change @@ -15,8 +15,18 @@ COPY InstallerOpenROAD.sh \
1515ARG options=""
1616ARG constantBuildDir="-constant-build-dir"
1717
18- ENV CFLAGS="-Wno-builtin-macro-redefined"
19- ENV CXXFLAGS="-Wno-builtin-macro-redefined"
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 -s /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++
28+ 
29+ ENV PATH="/usr/local/bin/wrapped-cc:$PATH"
2030
2131RUN ./DependencyInstaller.sh -base $options $constantBuildDir \
2232    && ./DependencyInstaller.sh -common $options $constantBuildDir \
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments