Skip to content

CMake modernization - platform detection#1345

Merged
hainest merged 20 commits intodyninst:cmake_modernizationfrom
hainest:cmake_platform_detection
Jan 6, 2023
Merged

CMake modernization - platform detection#1345
hainest merged 20 commits intodyninst:cmake_modernizationfrom
hainest:cmake_platform_detection

Conversation

@hainest
Copy link
Copy Markdown
Contributor

@hainest hainest commented Dec 22, 2022

Closes #707

This definitely needs a careful examination. I am fairly confident I didn't break anything and it tests fine, but a tiny typo could easily cause no issues.

Eventually, we'll want to clean up the internal macro checks to simplify platform detection, but that's beyond the scope of this work.

@hainest hainest requested review from bigtrak and kupsch December 22, 2022 23:46
@hainest hainest self-assigned this Dec 22, 2022
I previously thought it was only allowed on x86_64, but there is an old platform called i386-unknown-freebsd7.2.
@hainest
Copy link
Copy Markdown
Contributor Author

hainest commented Dec 23, 2022

Copy link
Copy Markdown
Contributor

@kupsch kupsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good except one remaining use of PLATFORM that should be DYNINST_OS_i386, and two places that could be changed to DYNINST_OS_UNIX. After fixing at least the first one, I approve.

if(PLATFORM MATCHES x86_64 OR PLATFORM MATCHES amd64)
if(DYNINST_ARCH_x86_64)
set(SRC_LIST ${SRC_LIST} src/emitElfStatic-x86.C src/relocationEntry-elf-x86.C)
elseif(PLATFORM MATCHES i386)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DYNINST_ARCH_i386

src/linuxbsd-x86-swk.C
src/freebsd-x86-swk.C)
elseif(PLATFORM MATCHES linux OR PLATFORM MATCHES freebsd)
elseif(DYNINST_OS_Linux OR DYNINST_OS_FreeBSD)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DYNINST_OS_UNIX

src/SymtabReader.C)

if(PLATFORM MATCHES freebsd OR PLATFORM MATCHES linux)
if(DYNINST_OS_FreeBSD OR DYNINST_OS_Linux)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DYNINST_OS_UNIX

@hainest
Copy link
Copy Markdown
Contributor Author

hainest commented Jan 6, 2023

I had actually fixed those, but evidently forgot to push them into this PR. Derp. Thanks for the close look!

@hainest hainest linked an issue Jan 6, 2023 that may be closed by this pull request
@hainest hainest merged commit 9c43a74 into dyninst:cmake_modernization Jan 6, 2023
@hainest hainest deleted the cmake_platform_detection branch January 6, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Canonicalize platform support

2 participants