-
Notifications
You must be signed in to change notification settings - Fork 15
llc only supports one input file #36
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -753,14 +753,26 @@ function(llvmir_attach_obj_target) | |
list(APPEND IN_FULL_LLVMIR_FILES "${IN_LLVMIR_DIR}/${IN_LLVMIR_FILE}") | ||
endforeach() | ||
|
||
set(FULL_OUT_LLVMIR_FILE "${WORK_DIR}/${TRGT}.o") | ||
if(SHORT_NAME) | ||
set(FULL_OUT_LLVMIR_FILE "${WORK_DIR}/${SHORT_NAME}.o") | ||
endif() | ||
get_filename_component(OUT_LLVMIR_FILE ${FULL_OUT_LLVMIR_FILE} NAME) | ||
foreach(IN_LLVMIR_FILE ${IN_FULL_LLVMIR_FILES}) | ||
get_filename_component(OUTFILE ${IN_LLVMIR_FILE} NAME_WE) | ||
set(OUT_LLVMIR_FILE "${OUTFILE}.o") | ||
set(FULL_OUT_LLVMIR_FILE "${WORK_DIR}/${OUT_LLVMIR_FILE}") | ||
|
||
list(APPEND OUT_LLVMIR_FILES ${OUT_LLVMIR_FILE}) | ||
list(APPEND FULL_OUT_LLVMIR_FILES ${FULL_OUT_LLVMIR_FILE}) | ||
add_custom_command(OUTPUT ${FULL_OUT_LLVMIR_FILE} | ||
COMMAND llc | ||
ARGS | ||
-filetype=obj | ||
-relocation-model=pic | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need this flag here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this flag because the compiler complained in my real project that I needed to recompile with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather not have project-specific options hardcoded like this. Can you please try your project with defining that flag in your |
||
-o=${FULL_OUT_LLVMIR_FILE} | ||
${LLVMIR_ATTACH_UNPARSED_ARGUMENTS} | ||
${IN_LLVMIR_FILE} | ||
DEPENDS ${IN_LLVMIR_FILE} | ||
COMMENT "Generating object ${OUT_LLVMIR_FILE}" | ||
VERBATIM) | ||
|
||
list(APPEND OUT_LLVMIR_FILES ${OUT_LLVMIR_FILE}) | ||
list(APPEND FULL_OUT_LLVMIR_FILES ${FULL_OUT_LLVMIR_FILE}) | ||
endforeach() | ||
|
||
# setup custom target | ||
add_custom_target(${TRGT} DEPENDS ${FULL_OUT_LLVMIR_FILES}) | ||
|
@@ -786,16 +798,6 @@ function(llvmir_attach_obj_target) | |
set_property(TARGET ${TRGT} PROPERTY EXCLUDE_FROM_ALL On) | ||
set_property(TARGET ${TRGT} PROPERTY LLVMIR_SHORT_NAME ${SHORT_NAME}) | ||
|
||
add_custom_command(OUTPUT ${FULL_OUT_LLVMIR_FILE} | ||
COMMAND llc | ||
ARGS | ||
-filetype=obj | ||
${LLVMIR_ATTACH_UNPARSED_ARGUMENTS} | ||
-o ${FULL_OUT_LLVMIR_FILE} ${IN_FULL_LLVMIR_FILES} | ||
DEPENDS ${IN_FULL_LLVMIR_FILES} | ||
COMMENT "Generating object ${OUT_LLVMIR_FILE}" | ||
VERBATIM) | ||
|
||
## postamble | ||
endfunction() | ||
|
||
|
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.
Isn't
SHORT_NAME
still useful for the multiple output files generated by the changes in your 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.
In my project it worked fine without it, so I assumed that I could just remove it.
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.
Can you please reintroduce it and check that your project still works?
Just because it's not needed in your configuration doesn't mean that wasn't introduced for a reason initially.