LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 52418 - Incomplete support for `--target`in the code-gen layer
Summary: Incomplete support for `--target`in the code-gen layer
Status: NEW
Alias: None
Product: flang
Classification: Unclassified
Component: Driver (show other bugs)
Version: trunk
Hardware: PC All
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-05 03:34 PDT by Andrzej Warzynski
Modified: 2021-11-05 03:34 PDT (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrzej Warzynski 2021-11-05 03:34:50 PDT
This came up during a discussion on https://reviews.llvm.org/D112961.

As per the comment at the top of "flang/lib/Optimizer/CodeGen/DescriptorModel.h", various assumptions about the target machine are made in the code-gen layer. This is likely to cause `--target` (or e.g. `-m64` and `-m32`) to malfunction when using Flang's interoperability with C (see how various CFI structures are lowered).

Note that `--target` is not available in the driver yet. Also, it is possible that the assumptions made when lowering the CFI structures will affect other parts of the code-gen too. However, I suspect that most things will work correctly when generating code for the host/native target.

I'm creating this issue as a placeholder and as a note for our future selves. This is currently _not_ being investigated or worked on.

-Andrzej

[1] https://github.com/flang-compiler/f18-llvm-project
[2] https://github.com/llvm/llvm-project