From: James K. Lowden Date: Thu, 23 Jul 2026 14:59:20 +0000 (-0400) Subject: cobol: Handle -Wno options and -fPIC better in gcobc emulation script. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eb25d3e4806a331ac51dfbc0b306d7deaea43b85;p=thirdparty%2Fgcc.git cobol: Handle -Wno options and -fPIC better in gcobc emulation script. Make -fPIC the default except when producing an executable. Add handling of -Wno- options. gcc/cobol/ChangeLog: * gcobc: Consolidate warning cases and update comments. --- diff --git a/gcc/cobol/gcobc b/gcc/cobol/gcobc index 754a2b4da49..6e0741cd61f 100755 --- a/gcc/cobol/gcobc +++ b/gcc/cobol/gcobc @@ -173,8 +173,6 @@ EOF } dialect="mf gnu" -out_set="" -first="" # # Iterate over the command-line tokens. We can't use getopts here @@ -235,8 +233,6 @@ do opt="$(echo "$opt" | sed -E 's/-f(no-)?ec=/-f\1cobol-exceptions=EC-/g')" opts="$opts $opt" ;; - -fno-ec=*) - ;; # just ignore for now to work around "sorry unimplemented" errors -ext) pending_arg="-copyext " ;; @@ -515,7 +511,8 @@ do ;; -v | --verbose) opts="$opts -V" ;; - # note: we want -dumpversion to be passed to gcc + # -dumpversion, like all options not handled specifically, is + # passed by default. -V | --version | -version) $gcobol --version | awk '1 == NR { ver = $3; @@ -524,12 +521,9 @@ do exit # opts="$opts --version" ;; - # pass through, strangely -Wall is not supported - # note that cobc does not support gcc's -Wl options, but they - # might be passed anyway for different reasons e.g.: -Wl,rpath. - -w | -W | -Wextra | -Wl,*) opts="$opts $opt" - ;; - -Wno-*) no_warn "$opt" + # pass through, -Wall support pending gcc to set for all front ends + # cobc does not support all gcc -Wl options + -w | -W | -Wextra | -Wno-* | -Wl,*) opts="$opts $opt" ;; -W*) warn "$opt" @@ -554,7 +548,7 @@ do output_name="$output_name".so ;; esac - opts="$opts $cflags -o $output_name" + opts="$opts -o $output_name" fi opts="$opts $opt" # pass through ;; @@ -588,4 +582,4 @@ then set -x fi -exec $gcobol $mode $dialect $opts +exec $gcobol $mode $dialect $cflags $opts