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

CMake: Add support for pasm2asm on NASM source files #3042

Closed
wants to merge 1 commit into from

Conversation

dnakamura
Copy link
Contributor

Signed-off-by: Devin Nakamura devinn@ca.ibm.com

@dnakamura dnakamura changed the title CMake: Add support for pasm2asm on NASM source files WIP: CMake: Add support for pasm2asm on NASM source files Oct 9, 2018
Signed-off-by: Devin Nakamura <devinn@ca.ibm.com>
@dnakamura dnakamura changed the title WIP: CMake: Add support for pasm2asm on NASM source files CMake: Add support for pasm2asm on NASM source files Oct 9, 2018
@charliegracie
Copy link
Contributor

Why do we need to run a preprocess on the nasm files? Can you provide an example? NASM should have enough support that a preprocessor seems redundant and cumbersome for no reason.

@dnakamura
Copy link
Contributor Author

.pnasm files do exist in OpenJ9. (https://github.com/eclipse/openj9/blob/master/runtime/compiler/x/runtime/X86PicBuilder.pnasm)

It looks like its just so that it can consume j9cfg.h

@charliegracie
Copy link
Contributor

As far as I can tell j9cfg.h from the OpenJ9 project is a generated file.... wouldn't it make more sense to generate a NASM consumable version of j9cfg.h (j9cfgh.inc?) and include that properly in NASM instead of preprocessing all of the NASM files?

@0xdaryl
Copy link
Contributor

0xdaryl commented Oct 10, 2018

I believe there is only one #define that's needed from j9cfg.h. @nbhuiyan planned on modifying the jilconsts generator to add the needed definition in there to avoid this dependency. That work is planned for by end of October. The initial version, however, still relies on the C preprocessor unfortunately.

@charliegracie
Copy link
Contributor

From a quick look at jilconsts.h and jilconsts.c it would be a smaller change to add this one define to be written out in writeConstants than it would be to make this change. This change is small but adding 3 lines to jilconsts.c would be just as easy and would happen in the project that requires the code and not pus work down onto OMR which technically does not belong in this project.

I could be missing something about jilconsts?

@charliegracie
Copy link
Contributor

I would personally prefer to see new work for a downstream project happen in the downstream project and not in OMR whenever possible. If it is a matter of adding 1 new constant to jilconsts would that actually be easier / simpler than making a change in OMR and forcing cpp to be run on the files?

@0xdaryl
Copy link
Contributor

0xdaryl commented Oct 11, 2018

@nbhuiyan : you've studied that code more than I have. Is the change that straightforward? If so, please make it in OpenJ9 so we can avoid this OMR dependence.

@nbhuiyan
Copy link
Contributor

@0xdaryl Yes, the change is pretty straightforward. I was already planning on not making use of the C Preprocessor right when I was preparing the initial version of the NASM files. However, I decided to delay that as there were suddenly some activity over the last month in the MASM-equivalent .pasm files, and resulted in even more reliance on the C Preprocessor in X86PicBuilder.

I think we can get rid of the .pnasm files easily through writing the constant out into jilconsts.inc. I agree with @charliegracie and think we should not have to make a change in OMR for something like this.

@nbhuiyan
Copy link
Contributor

@0xdaryl @charliegracie @dnakamura eclipse-openj9/openj9#3243 would remove the need for the C preprocessor for NASM files.

@0xdaryl
Copy link
Contributor

0xdaryl commented Oct 11, 2018

Thanks. This PR should be closed then.

@charliegracie
Copy link
Contributor

Closing as per the comment from @nbhuiyan

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.

4 participants