On 22 Dec 12:48, Thomas Schwinge wrote:
> What is the reason for adding paths if $tgt_dir is empty?  (I mean, if
> properly installed and $tgt_dir empty, this should just work, because
> that's what a user will be doing, so why does the libgomp testsuite have
> to do differently?)

The case for empty $tgt_dir is required when offload compiler is installed, but
host compiler isn't.

> These paths will (basically) point to GCC's
> configured --prefix=[...] -- which may not actually match where the
> installed offloading compilers are to be found, for example, in the
> common case that DESTDIR is used with make install.  And, isn't it that
> GCC by default will already be looking into "$prefix" installation
> directories, or is this solving an actual problem for you?  If not, is it
> then OK to remove the cases for empty $tgt_dir?

If DESTDIR is used, then $tgt_dir can not be empty, otherwise during the build
of host compiler the host's part of MIC plugin for libgomp will not find
target's part, which is built along with target compiler.

> Here is a patch to correctly match intelmic in $offload_targets; OK to
> commit, I assume?  I suppose I'm the first one to ever do build-tree
> testing?  (Jakub?)
> 
> --- libgomp/testsuite/lib/libgomp.exp
> +++ libgomp/testsuite/lib/libgomp.exp
> @@ -115,8 +115,7 @@ proc libgomp_init { args } {
>  
>      # Add liboffloadmic build directory in LD_LIBRARY_PATH to support
>      # non-fallback testing for Intel MIC targets
> -    if { [string match "*-intelmic-*" $offload_targets]
> -     || [string match "*-intelmicemul-*" $offload_targets] } {
> +    if { [string match "*,intelmic,*" ",$offload_targets,"] } {
>       append always_ld_library_path ":${blddir}/../liboffloadmic/.libs"
>       append always_ld_library_path ":${blddir}/../liboffloadmic/plugin/.libs"
>       # libstdc++ is required by liboffloadmic

OK, thanks.
I verified this case some time ago, but missed when it started failing, since
tests just become UNSUPPORTED or PASSED with host fallback, rather than FAILing.

> Here is a patch to fix 32-bit x86 Intel MIC offloading; OK to commit, I
> assume?
> 
>     $ find -name liboffloadmic_target.so.5
>     
> ./install/offload-x86_64-intelmicemul-linux-gnu/lib64/liboffloadmic_target.so.5
>     
> ./install/offload-x86_64-intelmicemul-linux-gnu/lib32/liboffloadmic_target.so.5
>     
> ./build-gcc-offload-x86_64-intelmicemul-linux-gnu/x86_64-intelmicemul-linux-gnu/32/liboffloadmic/.libs/liboffloadmic_target.so.5
>     
> ./build-gcc-offload-x86_64-intelmicemul-linux-gnu/x86_64-intelmicemul-linux-gnu/liboffloadmic/.libs/liboffloadmic_target.so.5
> 
> --- libgomp/configure.ac
> +++ libgomp/configure.ac
> @@ -304,7 +304,7 @@ if test x"$enable_offload_targets" != x; then
>      fi
>      if test x"$tgt_dir" != x; then
>        offload_additional_options="$offload_additional_options 
> -B$tgt_dir/libexec/gcc/\$(target_alias)/\$(gcc_version) -B$tgt_dir/bin"
> -      
> offload_additional_lib_paths="$offload_additional_lib_paths:$tgt_dir/lib64:$tgt_dir/lib"
> +      
> offload_additional_lib_paths="$offload_additional_lib_paths:$tgt_dir/lib64:$tgt_dir/lib:$tgt_dir/lib32"
>      else
>        offload_additional_options="$offload_additional_options 
> -B\$(libexecdir)/gcc/\$(target_alias)/\$(gcc_version) -B\$(bindir)"
>        
> offload_additional_lib_paths="$offload_additional_lib_paths:$toolexeclibdir"

OK, thanks.

  -- Ilya

Reply via email to