-
Notifications
You must be signed in to change notification settings - Fork 90
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
[SYCLomatc][Intercept-build] Refine intercept-build to work as normal compilation if the toolchain is available #2386
base: SYCLomatic
Are you sure you want to change the base?
Conversation
f0e3089
to
351e6a9
Compare
int is_ar_staticlib_cmd = 0; | ||
int is_tool_existence = 0; | ||
if (file_exists(argv[0])) { | ||
is_tool_existence = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_tool_available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
int has_parenthesis = 0; | ||
if (is_tool_existence) { | ||
for (size_t it = 0; it < argc; ++it) { | ||
fprintf(fd, "%s%c", argv[it], US); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug purpose printf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is used to collect options for current command.
ret = 0; // intercept-stub should continue to run. | ||
|
||
// intercept-stub is used to handle the compiler command like | ||
// "/bin/sh -c clang++ -c `echo ./`hello.c", it changes the compiler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please keep footprint as small as possible for a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those codes are in the else branch
in the code below, logic keeps same as old code
if (is_tool_existence) {
for (size_t it = 0; it < argc; ++it) {
fprintf(fd, "%s%c", argv[it], US);
}
} else {
...
}
if (ret == 1 && it_cp == 0 && !is_ar_staticlib_cmd) { | ||
exit(0); | ||
if(is_tool_existence) { | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's void function, so why " return 0"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not void function, shown as follows:
static int bear_report_call(char const *fun, char const *argv[]) {
#else
static void bear_report_call(char const *fun, char const *const argv[]) {
#endif // SYCLomatic_CUSTOMIZATION
} | ||
return call_eaccess(pathname, mode); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we keep it, just do a little refinement.
351e6a9
to
4721319
Compare
… compilation if all the toolchains are available Signed-off-by: chenwei.sun <chenwei.sun@intel.com>
Signed-off-by: chenwei.sun <chenwei.sun@intel.com>
Signed-off-by: chenwei.sun <chenwei.sun@intel.com>
Signed-off-by: chenwei.sun <chenwei.sun@intel.com>
Signed-off-by: chenwei.sun <chenwei.sun@intel.com>
Signed-off-by: chenwei.sun chenwei.sun@intel.com