Commit 51db86a8 by Jakub Jelinek Committed by Jakub Jelinek

target-libpath.exp (set_gcc_exec_prefix_env_var, [...]): New procedures.

	* lib/target-libpath.exp (set_gcc_exec_prefix_env_var,
	restore_gcc_exec_prefix_env_var): New procedures.
	(set_ld_library_path_env_vars,
	restore_ld_library_path_env_vars): Use them.
	* lib/c-compat.exp: Load target-libpath.exp.
	(compat-use-alt-compiler): Call restore_gcc_exec_prefix_env_var.
	(compat-use-tst-compiler): Call set_gcc_exec_prefix_env_var.
	* g++.dg/compat/compat.exp (compat-use-alt-compiler): Call
	restore_gcc_exec_prefix_env_var.
	* g++.dg/compat/struct-layout-1.exp (compat-use-alt-compiler):
	Likewise.

From-SVN: r211093
parent b3f1051b
2014-05-30 Jakub Jelinek <jakub@redhat.com> 2014-05-30 Jakub Jelinek <jakub@redhat.com>
* lib/target-libpath.exp (set_gcc_exec_prefix_env_var,
restore_gcc_exec_prefix_env_var): New procedures.
(set_ld_library_path_env_vars,
restore_ld_library_path_env_vars): Use them.
* lib/c-compat.exp: Load target-libpath.exp.
(compat-use-alt-compiler): Call restore_gcc_exec_prefix_env_var.
(compat-use-tst-compiler): Call set_gcc_exec_prefix_env_var.
* g++.dg/compat/compat.exp (compat-use-alt-compiler): Call
restore_gcc_exec_prefix_env_var.
* g++.dg/compat/struct-layout-1.exp (compat-use-alt-compiler):
Likewise.
* c-c++-common/asan/misalign-1.c: New test. * c-c++-common/asan/misalign-1.c: New test.
* c-c++-common/asan/misalign-2.c: New test. * c-c++-common/asan/misalign-2.c: New test.
......
...@@ -55,6 +55,7 @@ proc compat-use-alt-compiler { } { ...@@ -55,6 +55,7 @@ proc compat-use-alt-compiler { } {
set ALWAYS_CXXFLAGS "" set ALWAYS_CXXFLAGS ""
set ld_library_path $alt_ld_library_path set ld_library_path $alt_ld_library_path
set_ld_library_path_env_vars set_ld_library_path_env_vars
restore_gcc_exec_prefix_env_var
} }
} }
......
...@@ -60,6 +60,7 @@ proc compat-use-alt-compiler { } { ...@@ -60,6 +60,7 @@ proc compat-use-alt-compiler { } {
set ALWAYS_CXXFLAGS "" set ALWAYS_CXXFLAGS ""
set ld_library_path $alt_ld_library_path set ld_library_path $alt_ld_library_path
set_ld_library_path_env_vars set_ld_library_path_env_vars
restore_gcc_exec_prefix_env_var
} }
} }
......
...@@ -28,6 +28,7 @@ global compat_skip_list ...@@ -28,6 +28,7 @@ global compat_skip_list
# compilers for compatibility tests. # compilers for compatibility tests.
load_lib target-supports.exp load_lib target-supports.exp
load_lib target-libpath.exp
# #
# compat-use-alt-compiler -- make the alternate compiler the default # compat-use-alt-compiler -- make the alternate compiler the default
...@@ -47,6 +48,7 @@ proc compat-use-alt-compiler { } { ...@@ -47,6 +48,7 @@ proc compat-use-alt-compiler { } {
if { $compat_alt_color == 0 } then { if { $compat_alt_color == 0 } then {
regsub -- "-fdiagnostics-color=never" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS regsub -- "-fdiagnostics-color=never" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
} }
restore_gcc_exec_prefix_env_var
} }
} }
...@@ -64,6 +66,7 @@ proc compat-use-tst-compiler { } { ...@@ -64,6 +66,7 @@ proc compat-use-tst-compiler { } {
if { $compat_same_alt == 0 } then { if { $compat_same_alt == 0 } then {
set GCC_UNDER_TEST $compat_save_gcc_under_test set GCC_UNDER_TEST $compat_save_gcc_under_test
set TEST_ALWAYS_FLAGS $compat_save_TEST_ALWAYS_FLAGS set TEST_ALWAYS_FLAGS $compat_save_TEST_ALWAYS_FLAGS
set_gcc_exec_prefix_env_var
} }
} }
......
...@@ -28,6 +28,21 @@ set orig_gcc_exec_prefix_checked 0 ...@@ -28,6 +28,21 @@ set orig_gcc_exec_prefix_checked 0
####################################### #######################################
# proc set_gcc_exec_prefix_env_var { }
#######################################
proc set_gcc_exec_prefix_env_var { } {
global TEST_GCC_EXEC_PREFIX
global env
# Set GCC_EXEC_PREFIX for the compiler under test to pick up files not in
# the build tree from a specified location (normally the install tree).
if [info exists TEST_GCC_EXEC_PREFIX] {
setenv GCC_EXEC_PREFIX "$TEST_GCC_EXEC_PREFIX"
}
}
#######################################
# proc set_ld_library_path_env_vars { } # proc set_ld_library_path_env_vars { }
####################################### #######################################
...@@ -49,7 +64,6 @@ proc set_ld_library_path_env_vars { } { ...@@ -49,7 +64,6 @@ proc set_ld_library_path_env_vars { } {
global orig_ld_library_path_64 global orig_ld_library_path_64
global orig_dyld_library_path global orig_dyld_library_path
global orig_gcc_exec_prefix global orig_gcc_exec_prefix
global TEST_GCC_EXEC_PREFIX
global env global env
# Save the original GCC_EXEC_PREFIX. # Save the original GCC_EXEC_PREFIX.
...@@ -61,11 +75,7 @@ proc set_ld_library_path_env_vars { } { ...@@ -61,11 +75,7 @@ proc set_ld_library_path_env_vars { } {
set orig_gcc_exec_prefix_checked 1 set orig_gcc_exec_prefix_checked 1
} }
# Set GCC_EXEC_PREFIX for the compiler under test to pick up files not in set_gcc_exec_prefix_env_var
# the build tree from a specified location (normally the install tree).
if [info exists TEST_GCC_EXEC_PREFIX] {
setenv GCC_EXEC_PREFIX "$TEST_GCC_EXEC_PREFIX"
}
# Setting the ld library path causes trouble when testing cross-compilers. # Setting the ld library path causes trouble when testing cross-compilers.
if { [is_remote target] } { if { [is_remote target] } {
...@@ -164,6 +174,22 @@ proc set_ld_library_path_env_vars { } { ...@@ -164,6 +174,22 @@ proc set_ld_library_path_env_vars { } {
} }
####################################### #######################################
# proc restore_gcc_exec_prefix_env_var { }
#######################################
proc restore_gcc_exec_prefix_env_var { } {
global orig_gcc_exec_prefix_saved
global orig_gcc_exec_prefix
global env
if { $orig_gcc_exec_prefix_saved } {
setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix"
} elseif [info exists env(GCC_EXEC_PREFIX)] {
unsetenv GCC_EXEC_PREFIX
}
}
#######################################
# proc restore_ld_library_path_env_vars { } # proc restore_ld_library_path_env_vars { }
####################################### #######################################
...@@ -175,21 +201,15 @@ proc restore_ld_library_path_env_vars { } { ...@@ -175,21 +201,15 @@ proc restore_ld_library_path_env_vars { } {
global orig_ld_library_path_32_saved global orig_ld_library_path_32_saved
global orig_ld_library_path_64_saved global orig_ld_library_path_64_saved
global orig_dyld_library_path_saved global orig_dyld_library_path_saved
global orig_gcc_exec_prefix_saved
global orig_ld_library_path global orig_ld_library_path
global orig_ld_run_path global orig_ld_run_path
global orig_shlib_path global orig_shlib_path
global orig_ld_library_path_32 global orig_ld_library_path_32
global orig_ld_library_path_64 global orig_ld_library_path_64
global orig_dyld_library_path global orig_dyld_library_path
global orig_gcc_exec_prefix
global env global env
if { $orig_gcc_exec_prefix_saved } { restore_gcc_exec_prefix_env_var
setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix"
} elseif [info exists env(GCC_EXEC_PREFIX)] {
unsetenv GCC_EXEC_PREFIX
}
if { $orig_environment_saved == 0 } { if { $orig_environment_saved == 0 } {
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment