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

[SYCL][Driver] Improve fat static library support #1319

Merged
merged 7 commits into from
Mar 19, 2020

Conversation

mdtoguchi
Copy link
Contributor

When processing libraries on the command line, take into account any thusly
named static archive (*.a) file and consider that for offloading. We will
also scan the appropriate linker options passed in so we can determine if
the library should be considered as whole-archive. The static libraries
found on the command line will be 'sniffed' to determine if the static
library is fat.

This effectively negates the need to use -foffload-static-lib and
-foffload-whole-static-lib which we should consider deprecated now.

Add a deprecated diagnostic when -foffload-static-lib is used

Refactor to bring along common code for the device check. Narrows the focus
of what is considered to be processed from the linker only arguments. Pulls
in objects from -Wl, instead of only archives, but is only part of a potential
partial link step and is not fully processed.

Signed-off-by: Michael D Toguchi michael.d.toguchi@intel.com

When processing libraries on the command line, take into account any thusly
named static archive (*.a) file and consider that for offloading.  We will
also scan the appropriate linker options passed in so we can determine if
the library should be considered as whole-archive.  The static libraries
found on the command line will be 'sniffed' to determine if the static
library is fat.

This effectively negates the need to use -foffload-static-lib and
-foffload-whole-static-lib which we should consider deprecated now.

Add a deprecated diagnostic when -foffload-static-lib is used

Refactor to bring along common code for the device check.  Narrows the focus
of what is considered to be processed from the linker only arguments.  Pulls
in objects from -Wl, instead of only archives, but is only part of a potential
partial link step and is not fully processed.

Signed-off-by: Michael D Toguchi <michael.d.toguchi@intel.com>
Signed-off-by: Michael D Toguchi <michael.d.toguchi@intel.com>
Copy link
Contributor

@AGindinson AGindinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall logic & phases changes look good, the code as a whole feels better structured now! I'll update with more specific comments (if any) later today.

clang/lib/Driver/ToolChains/Clang.cpp Outdated Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Outdated Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Outdated Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Outdated Show resolved Hide resolved
Signed-off-by: Michael D Toguchi <michael.d.toguchi@intel.com>
Copy link
Contributor

@AGindinson AGindinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some more minor stuff, the structure looks good!

clang/lib/Driver/Driver.cpp Outdated Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Outdated Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Outdated Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Outdated Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Outdated Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Outdated Show resolved Hide resolved
Make adjustments according to recent reviews, also add -rpath as an
additional -Wl check, adding a test for that as well.

Signed-off-by: Michael D Toguchi <michael.d.toguchi@intel.com>
Signed-off-by: Michael D Toguchi <michael.d.toguchi@intel.com>
AGindinson
AGindinson previously approved these changes Mar 17, 2020
clang/test/Driver/sycl-offload-static-lib.cpp Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Show resolved Hide resolved
clang/lib/Driver/Driver.cpp Outdated Show resolved Hide resolved
Signed-off-by: Michael D Toguchi <michael.d.toguchi@intel.com>
Use SmallVector for bundler args, add TODOs for -foffload-static-lib removal

Signed-off-by: Michael D Toguchi <michael.d.toguchi@intel.com>
@bader bader merged commit be07751 into intel:sycl Mar 19, 2020
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Mar 20, 2020
* sycl: (1209 commits)
  [SYCL] Check exit status get_device_count_by_type
  [SYCL][Doc] Update sub-group extension docs (intel#1330)
  [SYCL][Doc] Add leader to GroupAlgorithms (intel#1297)
  [SYCL] Add SYCL headers search path to default compilation options (intel#1347)
  [SYCL][PI] Add interoperability with generic handles to device and program classes (intel#1244)
  Move SPIR devicelib to top level (intel#1276)
  [SYCL][Driver] Improve fat static library support (intel#1319)
  [SYCL] Remove image_api LIT (intel#1349)
  [SYCL] Fix headers location for check-sycl-deploy target
  [SYCL] Allow gcc asm statements in kernel code (intel#1341)
  [SYCL] Add Intel FPGA force_pow2_depth attribute (intel#1284)
  [SPIR-V][NFC] Fix for building llvm-spirv with -DLLVM_LINK_LLVM_DYLIB=ON (intel#1323)
  [SYCL][NFC] Fix execution graph dump (intel#1331)
  [SYCL][Doc] Release SYCL_INTEL_enqueue_barrier extension document (intel#1199)
  [SYCL][USM] Fix USM malloc_shared and free to handle zero byte (intel#1273)
  [SYCL] Fix undefined symbols in async_work_group_copy (intel#1243)
  [SYCL] Mark calls to barrier and work-item functions as convergent
  [SYCL][CUDA] Fix CUDA plug-in build with enabled assertions (intel#1325)
  [SYCL][Test] Add OpenCL requirement to test/ordered_queue/prop.cpp (intel#1335)
  [SYCL][CUDA] Improve CUDA backend documentation (intel#1293)
  ...
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.

3 participants