This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget][amdgpu][nfc] Fix build on centos
ClosedPublic

Authored by JonChesterfield on Jan 12 2021, 10:00 AM.

Details

Summary

[libomptarget][amdgpu][nfc] Fix build on centos

rtl.cpp replaced 224 with a #define from elf.h, but that
doesn't work on a centos 7 build machine with an old elf.h

Diff Detail

Event Timeline

JonChesterfield requested review of this revision.Jan 12 2021, 10:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 12 2021, 10:00 AM

Adding Tony and Ron as reviewers, since I think one of you replaced the 224 literal.

We could expose amdgcnMachineID=224 in a header which is included by a file that includes llvm's elf.h, and static_assert that 224 is indeed the right value, but I don't think the line noise is worth it.

This revision is now accepted and ready to land.Jan 12 2021, 11:17 AM
t-tye added inline comments.Jan 12 2021, 11:30 AM
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
641

What ELF header file is being used? Should it be using the LLVM provide one which does have the definition? Or is this file part of a component that does not want a dependency on LLVM headers even though it is present in the LLVM code base?

This revision was landed with ongoing or failed builds.Jan 12 2021, 11:40 AM
This revision was automatically updated to reflect the committed changes.
JonChesterfield added a comment.EditedJan 12 2021, 12:56 PM

This file uses the system elf.h because it uses libelf. Sadly llvm's elf.h and the gnu elf.h conflict if both are included.

I'm vaguely inclined to drop the dependency on libelf, but as libomptarget uses it anyway it wouldn't make much difference.