Open
Conversation
Sooo. I essentially copied over the Aarch64 files, added the appropriate machine dependant files and renamed "a couple of structs". Next I ran `gcc -dM -E - < /dev/null` and copied that into `c2mir/armv7/mirc_armv7_linux.h`. I built and ran but I received an error. It did not segfault. I am using a different build tool called xmake, the build file is stashed in my russellhaley/mircVM project.
Author
|
This is the current message: Stackoverflow implies this is a 64/32 bit issue: I'll dig again tomorrow or Monday. Cheers! |
|
Good job |
Went through and aligned the existing defines in the Aarch64 file with the output from gcc on an armv7 board (beaglebone black: https://beagleboard.org/black and https://www.ti.com/product/AM3358).
Followed warnings in gcc and changed int64_t to intptr_t, and uint64_t to uintptr_t.
RussellHaley
commented
Feb 16, 2021
| "--adjust-vma=0x%llx -d %s.o; rm -f " | ||
| "%s.o %s %s", | ||
| cfname, cfname, bfname, cfname, (unsigned long long) start_addr, cfname, cfname, cfname, | ||
| cfname, cfname, bfname, cfname, (uintptr_t) start_addr, cfname, cfname, cfname, |
Author
There was a problem hiding this comment.
This change causes the following warning on Ubuntu 20 64 bit VM:
osboxes@osboxes ~/g/m/mir ((299fa499…))> make -j 10
gcc -I. -MMD -MP -g -std=gnu11 -Wno-abi -fsigned-char -fno-tree-sra -fno-ipa-cp-clone -O3 -DNDEBUG -DMIR_PARALLEL_GEN -c mir.c -o mir.o
gcc -I. -MMD -MP -g -std=gnu11 -Wno-abi -fsigned-char -fno-tree-sra -fno-ipa-cp-clone -O3 -DNDEBUG -DMIR_PARALLEL_GEN -c mir-gen.c -o mir-gen.o
gcc -I. -MMD -MP -g -std=gnu11 -Wno-abi -fsigned-char -fno-tree-sra -fno-ipa-cp-clone -O3 -DNDEBUG -DMIR_PARALLEL_GEN -c c2mir/c2mir.c -o c2mir/c2mir.o
gcc -I. -MMD -MP -g -std=gnu11 -Wno-abi -fsigned-char -fno-tree-sra -fno-ipa-cp-clone -O3 -DNDEBUG -DMIR_PARALLEL_GEN -c c2mir/c2mir-driver.c -o c2mir/c2mir-driver.o
gcc -I. -MMD -MP -g -std=gnu11 -Wno-abi -fsigned-char -fno-tree-sra -fno-ipa-cp-clone -O3 -DNDEBUG -DMIR_PARALLEL_GEN -c mir-utils/m2b.c -o mir-utils/m2b.o
gcc -I. -MMD -MP -g -std=gnu11 -Wno-abi -fsigned-char -fno-tree-sra -fno-ipa-cp-clone -O3 -DNDEBUG -DMIR_PARALLEL_GEN -c mir-utils/b2m.c -o mir-utils/b2m.o
gcc -I. -MMD -MP -g -std=gnu11 -Wno-abi -fsigned-char -fno-tree-sra -fno-ipa-cp-clone -O3 -DNDEBUG -DMIR_PARALLEL_GEN -c mir-utils/b2ctab.c -o mir-utils/b2ctab.o
mir-gen.c: In function ‘print_code’:
mir-gen.c:5206:12: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 7 has type ‘long unsigned int’ [-Wformat=]
5206 | "gcc -c -o %s.o %s 2>&1 && objcopy --update-section .text=%s %s.o && objdump "
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
5209 | cfname, cfname, bfname, cfname, (uintptr_t) start_addr, cfname, cfname, cfname,
| ~~~~~~~~~~~~~~~~~~~~~~
| |
| long unsigned int
mir-gen.c:5207:31: note: format string is defined here
5207 | "--adjust-vma=0x%llx -d %s.o; rm -f "
| ~~~^
| |
| long long unsigned int
| %lx
mir-gen.c: In function ‘MIR_gen’:
mir-gen.c:5389:14: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Wformat=]
5389 | "Generation of code for %s: %lu MIR insns (addr=%llx, len=%lu) -- time %.2f ms\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
5392 | (uintptr_t) machine_code, (unsigned long) code_len,
| ~~~~~~~~~~~~~~~~~~~~~~~~
| |
| long unsigned int
mir-gen.c:109:29: note: in definition of macro ‘DEBUG’
109 | if (debug_file != NULL) code; \
| ^~~~
mir-gen.c:5389:65: note: format string is defined here
5389 | "Generation of code for %s: %lu MIR insns (addr=%llx, len=%lu) -- time %.2f ms\n",
| ~~~^
| |
| long long unsigned int
| %lx
ar rcs libmir.a mir.o mir-gen.o c2mir/c2mir.o
gcc c2mir/c2mir.o c2mir/c2mir-driver.o libmir.a -lm -ldl -lpthread -o c2m
gcc mir-utils/m2b.o libmir.a -lm -ldl -lpthread -o m2b ./libmir.a
gcc mir-utils/b2m.o libmir.a -lm -ldl -lpthread -o b2m ./libmir.a
gcc mir-utils/b2ctab.o libmir.a -lm -ldl -lpthread -o b2ctab ./libmir.a
RussellHaley
commented
Feb 16, 2021
| MIR_item_name (ctx, func_item), | ||
| (long unsigned) DLIST_LENGTH (MIR_insn_t, func_item->u.func->insns), | ||
| (unsigned long long) machine_code, (unsigned long) code_len, | ||
| (uintptr_t) machine_code, (unsigned long) code_len, |
Author
There was a problem hiding this comment.
This change causes a warning on 64 bit Ubuntu 20. (see comment above)
Author
|
A surprising number of the tests that build with cmake run correctly. Anyway, I'll leave it at that until you can come up for air. Fun stuff! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request is just to get comments.
Sooo. I essentially copied over the Aarch64 files, added the appropriate machine dependant files and renamed "a couple of structs".
Next I ran
gcc -dM -E - < /dev/nulland copied that intoc2mir/armv7/mirc_armv7_linux.h. I built and ran but I received an error. It did not segfault.I am using a different build tool called xmake, the build file is stashed in my russellhaley/mircVM project.
Output: