It's still possible that the wrong value is returned from the alias
of variable even if the program can be compiled without issue. This
improves the check by executing the binary to check the result.
If alias attribute can't be working properly, the @target_page in
exec-vary.c will always return zeroes when we have the following gcc
version and the combination of options "-O2 -flto=auto".
# gcc --version
gcc (GCC) 11.0.0 20210210 (Red Hat 11.0.0-0)
This abstracts the code from exec-vary.c and use it as indicator to
enable gcc alias attribute or not. The gcc alias attribute is disabled
for the cross-compiling case as the compiled binary isn't executable.
Signed-off-by: Gavin Shan <gshan@redhat.com>