Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to a white list of archs wrt. -m32/-m64 in cc cmdlines #3460

Merged
merged 1 commit into from
Jun 11, 2020

Conversation

kinke
Copy link
Member

@kinke kinke commented Jun 6, 2020

According to the gcc 10.1 cmdline docs.

According to the gcc 10.1 cmdline docs.
@kubo39
Copy link
Contributor

kubo39 commented Jun 7, 2020

Maybe it would be better to use -mx32 for x86_64-unknown-linux-gnux32, not sure LDC supports this architecture.
https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html

@kinke
Copy link
Member Author

kinke commented Jun 7, 2020

I doubt we support it, but yeah, it's a valid point - these hardcoded flags might be trouble. Adding them to ldc2.conf would be another option.

@kubo39
Copy link
Contributor

kubo39 commented Jun 7, 2020

This works fine for me.

$ ./build-ldc/bin/ldc2 --mtriple=riscv64-unknown-none-elf -mcpu=generic-rv64 \
  -mabi=lp64 -mattr=+m,+a,+c --gcc=./gcc/bin/riscv64-unknown-elf-gcc \
  -Xcc=-march=rv64imac -Xcc=-mabi=lp64 -g -betterC hello.d
$ spike pk hello
bbl loaded
Hello, World!

Full description: https://github.com/kubo39/ldc-riscv-hello

@kinke
Copy link
Member Author

kinke commented Jun 8, 2020

Nice. Is the -mabi option for LDC required? It's the first time I see it being used.

@kubo39
Copy link
Contributor

kubo39 commented Jun 8, 2020

Ahh, it's not needed. Only -Xcc=-mabi=lp64 is required.

@kinke kinke merged commit 84ef937 into ldc-developers:master Jun 11, 2020
@kinke kinke deleted the m64 branch June 11, 2020 11:35
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.

2 participants