Skip to content

Using flang for external tools requires specifying host endianness #86521

Open
@tarunprabhu

Description

@tarunprabhu

Several headers in flang require FLANG_BIG_ENDIAN or FLANG_LITTLE_ENDIAN to be defined. This causes compile-time errors when using the headers, for example in an out-of-tree flang-based tool. A minimum reproducer is the file below

#include <flang/Frontend/CompilerInvocation.h>

Compiling this in the most straightforward way produces this compile-time error.

include/flang/Common/uint128.h:269:2: error: #error host endianness is not known

This is not ideal. Tools should not be required to specify the host endianness themselves.

I have a draft PR here which replaces these preprocessor defines with equivalents from LLVM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flangFlang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions