Skip to content

Conda build env adds bunch of compiler flags affecting the resulting binaries #96

@kgugala

Description

@kgugala

In my local tests I got:

CXXFLAGS=-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem (...)/conda/include
DEBUG_CXXFLAGS=-fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-all -fno-plt -Og -g -Wall -Wextra -fvar-tracking-assignments -ffunction-sections -pipe -isystem (...)/conda/include
LDFLAGS=-Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,(...)/conda/lib -Wl,-rpath-link,(...)/conda/lib -L(...)/conda/lib
DEBUG_CFLAGS=-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-all -fno-plt -Og -g -Wall -Wextra -fvar-tracking-assignments -ffunction-sections -pipe -isystem (...)/conda/include
CPPFLAGS=-DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem (...)/conda/include
DEBUG_CPPFLAGS=-D_DEBUG -D_FORTIFY_SOURCE=2 -Og -isystem (...)/conda/include
CFLAGS=-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem (...)/conda/include

While -L or -isystem are understandable, there are some flags significantly affecting the resulting binaries e.g. -DNDEBUG or optimizations level options.

The -DNDEBUG flag hits us in chipsalliance/f4pga-examples#127. It disables all the asserts in Yosys, so conda built binaries were never triggering the issue.

(CC @mithro @litghost @mkurc-ant @tmichalak @tgorochowik @acomodi)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions