Bug 1543295 - g-ir-scanner is passing -mcet -fcf-protection flags when CC=clang
Summary: g-ir-scanner is passing -mcet -fcf-protection flags when CC=clang
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gobject-introspection
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Colin Walters
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-08 07:43 UTC by Philip Chimento
Modified: 2019-05-28 22:45 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-28 22:45:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Philip Chimento 2018-02-08 07:43:48 UTC
Description of problem:

Looks like from bug 1538725 the -mcet -fcf-protection flags are supposed to be passed to GCC 8. When CC=clang, g-ir-scanner still passes these flags, and Clang doesn't recognize them, causing the compilation to error out.

See discussion on https://gitlab.gnome.org/GNOME/gjs/commit/aded7106e3d1bf626c9f9b0578e707df16fcc51a#note_50463
and logs on, for example, https://gitlab.gnome.org/GNOME/gjs/-/jobs/6759

Version-Release number of selected component (if applicable):

gobject-introspection-1.54.1-5.fc28

How reproducible: Always

Steps to Reproduce:
1. Compile GJS with CC=clang

Actual results:

  GISCAN   Regress-1.0.gir
clang-6.0: error: unknown argument: '-mcet'
clang-6.0: error: unknown argument: '-fcf-protection'
Traceback (most recent call last):
  File "/usr/lib64/python3.6/distutils/unixccompiler.py", line 127, in _compile
    extra_postargs)
  File "/usr/lib64/python3.6/distutils/ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/usr/lib64/python3.6/distutils/spawn.py", line 36, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/usr/lib64/python3.6/distutils/spawn.py", line 159, in _spawn_posix
    % (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'clang' failed with exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/g-ir-scanner", line 66, in <module>
    sys.exit(scanner_main(sys.argv))
  File "/usr/lib64/gobject-introspection/giscanner/scannermain.py", line 547, in scanner_main
    shlibs = create_binary(transformer, options, args)
  File "/usr/lib64/gobject-introspection/giscanner/scannermain.py", line 422, in create_binary
    gdump_parser.get_error_quark_functions())
  File "/usr/lib64/gobject-introspection/giscanner/dumper.py", line 302, in compile_introspection_binary
    return dc.run()
  File "/usr/lib64/gobject-introspection/giscanner/dumper.py", line 168, in run
    introspection_obj = self._compile(c_path)
  File "/usr/lib64/gobject-introspection/giscanner/dumper.py", line 208, in _compile
    self._options.init_sections)
  File "/usr/lib64/gobject-introspection/giscanner/ccompiler.py", line 251, in compile
    output_dir=os.path.abspath(os.sep))
  File "/usr/lib64/python3.6/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/usr/lib64/python3.6/distutils/unixccompiler.py", line 129, in _compile
    raise CompileError(msg)
distutils.errors.CompileError: command 'clang' failed with exit status 1
make[1]: *** [Makefile:3497: Regress-1.0.gir] Error 1

Expected results:

Success

Additional info:

Comment 1 Daniel Berrangé 2018-02-13 10:31:56 UTC
This isn't really a gobject-introspection problem to fix IMHO. The root cause is the redhat-rpm-config compiler flags were change to include flags which only work with GCC, where previously the flags were always compatible with both GCC and CLang. Ideally redhat-rpm-config cflags would remain compatible with clang by default, or it should provide a second macro that is compatible with clang that RPMs can opt-in to using.

Comment 2 Philip Chimento 2018-02-14 04:08:07 UTC
Can you forward it to the correct component then?

Comment 3 Fedora End Of Life 2018-02-20 15:26:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Comment 4 Colin Walters 2018-05-31 14:40:56 UTC
There's some upstream g-i bug where we switched to distutils - and it's Python's distutils that is capturing the compiler flags used to build it.

IIRC, the mess here is that distutils works a lot better on Windows than what g-i as doing before.

Comment 5 Arnaldo Carvalho de Melo 2018-10-05 19:16:16 UTC
I have the same problems with tools/perf, have been fixing it with a dirty trick,
checking if it is clang, tweaking the CFLAGS, but this trick explodes with python3 :-\

My setup.py:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/setup.py

Trying now to do this more nicely, suggestions welcome.

Comment 6 Ben Cotton 2019-05-02 20:44:25 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Ben Cotton 2019-05-28 22:45:47 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.