Skip to content

Commit

Permalink
Remove -fpermissive from BSC's C/C++ compiles
Browse files Browse the repository at this point in the history
Also remove filters for the warning messages (when erroneously using it
in C compiler calls) from the testsuite.  And remove its use in compiling
SystemC designs in the testsuite.  This resolves issue 509.
  • Loading branch information
quark17 committed Dec 21, 2022
1 parent 36bfdb8 commit 45231ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
7 changes: 2 additions & 5 deletions src/comp/bsc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,6 @@ cmdCompileBluesimCFile flags cName = do
-- is known to be safe.
switches = incflags ++
[ "-Wno-uninitialized"
, "-fpermissive"
, "-fPIC"
, "-c"
, "-o"
Expand All @@ -1539,8 +1538,7 @@ compileVPICFile errh flags cName = do
let incflags = map (("-I"++) . show) (cIncPath flags) ++
["-I" ++ show (bluespecDir flags) ++ "/VPI"]
switches = incflags ++
[ "-fpermissive"
, "-fPIC"
[ "-fPIC"
, "-c"
, "-o"
, show (mangleFileName oName)
Expand Down Expand Up @@ -1578,8 +1576,7 @@ cmdCompileUserCFile flags forVerilog cName = do
-- show is used for quoting
let incflags = map (("-I"++) . show) (cIncPath flags)
switches = incflags ++
[ "-fpermissive"
, "-fPIC"
[ "-fPIC"
, "-c"
, "-o"
, show (mangleFileName oName)
Expand Down
12 changes: 4 additions & 8 deletions testsuite/bsc.options/options.exp
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,13 @@ if { $vtest == 1 } {
}

if { $ctest == 1 } {
# filter out cc warnings
sed [make_bsc_ccomp_output_name sysGCD] \
[make_bsc_ccomp_output_name sysGCD].filtered \
{-e /fpermissive/d} {}
compare_file [make_bsc_ccomp_output_name sysGCD].filtered empty.expected
compare_file [make_bsc_ccomp_output_name sysGCD] empty.expected
}
if { $vtest == 1 } {
# filter out cc/iverilog warnings
# filter out iverilog warnings
set rawfile [make_bsc_vcomp_output_name sysGCD]
set filtfile "$rawfile.filtered"
set ere {-e /fpermissive/d -e /WARNING:\ IVerilog/d -e /not\ guaranteed/d}
set ere {-e /WARNING:\ IVerilog/d -e /not\ guaranteed/d}
# iverilog 10.1 has spurious warnings
if { $verilog_compiler == "iverilog" && $verilog_compiler_version == "10.1" } {
append ere { -e {/inherits dimensions from var/d}}
Expand All @@ -310,7 +306,7 @@ if { $ctest == 1 } {
# so we have to filter out the make entering/leaving messages
sed [make_bsc_ccomp_output_name sysGCD] \
[make_bsc_ccomp_output_name sysGCD].parallel.filtered \
{-e /fpermissive/d -e /make.*:\ Entering\ directory/d -e /make.*:\ Leaving\ directory/d} {}
{-e /make.*:\ Entering\ directory/d -e /make.*:\ Leaving\ directory/d} {}
compare_file [make_bsc_ccomp_output_name sysGCD].parallel.filtered empty.expected
}

Expand Down
2 changes: 1 addition & 1 deletion testsuite/config/unix.exp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ proc build_systemc_executable { exe sysc_srcs bsim_top_mods { bsim_other_mods ""
lappend objs model_${mod}.o
}

set cmd "$cxx -fpermissive $options $systemc_paths $bluesim_paths -o $scexe $objs -x c++ $sysc_srcs $systemc_libs $bluesim_libs $thread_libs $rpath >& $output"
set cmd "$cxx $options $systemc_paths $bluesim_paths -o $scexe $objs -x c++ $sysc_srcs $systemc_libs $bluesim_libs $thread_libs $rpath >& $output"
verbose "Executing : $cmd" 4
set status [exec_with_log "build_systemc_executable" $cmd 2]
cd $here
Expand Down

0 comments on commit 45231ea

Please sign in to comment.