Skip to content

Linking failure (due to -Werror) with LTO #528

Open
@ArchangeGabriel

Description

@ArchangeGabriel

When compiling with LTO, the build ultimately fails like this:

/build/intel-compute-runtime/src/compute-runtime-22.12.22749/third_party/uapi/drm/i915_drm.h:2951: error: type ‘struct drm_i915_gem_create_ext’ violates the C++ One Definition Rule [-Werror=odr]
 2951 | struct drm_i915_gem_create_ext {
      | 
/build/intel-compute-runtime/src/compute-runtime-22.12.22749/third_party/uapi/dg1/drm/i915_drm.h:726: note: a different type is defined in another translation unit
  726 | struct drm_i915_gem_create_ext {
      | 
/build/intel-compute-runtime/src/compute-runtime-22.12.22749/third_party/uapi/drm/i915_drm.h:2971: note: the first difference of corresponding definitions is field ‘flags’
 2971 |         __u32 flags;
      | 
/build/intel-compute-runtime/src/compute-runtime-22.12.22749/third_party/uapi/dg1/drm/i915_drm.h:740: note: a field with different name is defined in another translation unit
  740 |         __u32 pad;
      | 
/build/intel-compute-runtime/src/compute-runtime-22.12.22749/third_party/uapi/drm/i915_drm.h:2951: error: type ‘struct drm_i915_gem_create_ext’ violates the C++ One Definition Rule [-Werror=odr]
 2951 | struct drm_i915_gem_create_ext {
      | 
/build/intel-compute-runtime/src/compute-runtime-22.12.22749/third_party/uapi/dg1/drm/i915_drm.h:726: note: a different type is defined in another translation unit
  726 | struct drm_i915_gem_create_ext {
      | 
/build/intel-compute-runtime/src/compute-runtime-22.12.22749/third_party/uapi/drm/i915_drm.h:2971: note: the first difference of corresponding definitions is field ‘flags’
 2971 |         __u32 flags;
      | 
/build/intel-compute-runtime/src/compute-runtime-22.12.22749/third_party/uapi/dg1/drm/i915_drm.h:740: note: a field with different name is defined in another translation unit
  740 |         __u32 pad;
      | 
lto1: all warnings being treated as errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions