Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Issues
  • #5266
Closed
Open
Issue created Dec 23, 2021 by Administrator@rootContributor

Support CFLAGS

Created by: dvyukov

I am trying to figure out how to pass additional CFLAGS when building libraries. The only option I found that works now is overriding CC to include a compiler with the flags:

(rm -rf dynamorio-test && mkdir -p dynamorio-test && cd dynamorio-test && \
CC="gcc -fsanitize=address" cmake -GNinja ../third_party/dynamorio && \
ninja libdrdecode.a && \
objdump -d lib64/libdrdecode.a | grep 0x7fff8000 | wc -l)
4141

But the following options don't work 

(rm -rf dynamorio-test && mkdir -p dynamorio-test && cd dynamorio-test && \
CFLAGS="-fsanitize=address" cmake -GNinja ../third_party/dynamorio && \
ninja libdrdecode.a && \
objdump -d lib64/libdrdecode.a | grep 0x7fff8000 | wc -l)
0

and:

(rm -rf dynamorio-test && mkdir -p dynamorio-test && cd dynamorio-test && \
cmake -GNinja -DCMAKE_C_FLAGS="-fsanitize=address" ../third_party/dynamorio && \
ninja libdrdecode.a && \
objdump -d lib64/libdrdecode.a | grep 0x7fff8000 | wc -l)
0

Overriding CC is quite inconvenient when combined with cross-compilation/toolchains. I see docs mention setting CFLAGS=-m32. I am not sure if this broken, or wasn't supported, or I am holding it wrong...

Assignee
Assign to
Time tracking