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

Incorrect javac options #14

Closed
wants to merge 2 commits into from
Closed

Conversation

ketanpatil3
Copy link

Ant appends "-g:none" by default. "-g:lines,vars,source" is a mandatory field for javac since debug information in the class file is used by the convertor

Ant appends "-g:none" as default. "-g:lines,vars,source" is a mandatory field for javac since debug information in the class file is used by the convertor
@martinpaljak
Copy link
Owner

Could you give some pointers to why compiling with debug information is mandatory ?

@ketanpatil3
Copy link
Author

ketanpatil3 commented Dec 19, 2016

The debug info inside classes is used by the convertor(com.sun.javacard.converter.Converter) to generate cap files. Without that the convertor gives out compile error stating "unsupported int type of intermediate value, must cast intermediate value to type short or byte". I will try to provide sample code demonstrating this.

@martinpaljak
Copy link
Owner

I should make it more clear that by default converter code in ant-javacard does not enable integer support.

I found another interesting reference, I did not know this before: https://docs.oracle.com/javacard/3.0.5/devnotes/index.html#BAJBJAHF

@martinpaljak
Copy link
Owner

In the light of the known issue with 3.0.5u1 kit and the missing support for int32, I will rephrase the goal of this ticket in a new ticket: add support for int types.

Int support is not that popular in commonly, freely available cards. Thus I will not enable this by default. If you can provide something I can verify or test, I might reconsider. For now, you can manually enable debug mode if needed.

@ketanpatil3
Copy link
Author

The problem is not with the int flag. I have manually disabled it since my card does not support it. The debug option is mandatory. Please compile the code using JCDE it also uses "-g:lines,vars,source".
Without the debug flag my class size was 21kB but with it is around 34kB. JCDE also gives out 34kB.

martinpaljak added a commit that referenced this pull request Dec 20, 2016
@martinpaljak
Copy link
Owner

You are right, the user guide suggests to compile always with -g. Nevertheless, casting your local variables and intermediates to short-s gives good assurance that you know line-by-line what your applet is doing.

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.

None yet

2 participants