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

1) Added new code under linux-tools , this code can be usefull for b… #122

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions linux-tools/prelink/prelink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,22 @@ function tc_local_setup()
{
tc_exec_or_break $REQUIRED || return

tc_exist_or_break /etc/prelink.conf /etc/sysconfig/prelink || return
#tc_exist_or_break /etc/prelink.conf /etc/sysconfig/prelink || return
tc_exist_or_break /etc/prelink.conf /usr/sbin/prelink || return

Copy link
Contributor

Choose a reason for hiding this comment

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

Please Correct Summary !

In tc_exec_or_break $REQUIRED prelink check is done.
And how about distros which has /etc/sysconfig/prelink ? This change has to be made generic to work in all the cases.

tc_get_os_arch
userlibdir=/usr/lib
libdir=/lib/
[ $TC_OS_ARCH = "x86_64" ] || [ $TC_OS_ARCH = "ppc64" ] || [ $TC_OS_ARCH = "s390x" ] \
&& userlibdir=/usr/lib64/ && \
libdir=/lib64/
# On Ubuntu usrlib and lib paths are diff, so modified the code based on that
grep -i "ubuntu" /etc/*-release >/dev/null 2>&1
Copy link
Contributor

Choose a reason for hiding this comment

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

Below change is specific for x86_64 arch. but prelink is available for power as well.
Please modify this change to work on all archs.

if [ $? -eq 0 ];then # Start of OS check
userlibdir="/usr/lib/x86_64-linux-gnu/"
libdir=/lib/x86_64-linux-gnu/
fi

PRELINK="/usr/sbin/prelink -c ./prelink.conf -C ./prelink.cache --ld-library-path=."

cat >> $TSTDIR/prelink.conf <<-EOF
Expand Down Expand Up @@ -182,9 +190,13 @@ function test02()
tc_fail "prelink failed on bogus library dependency" || return

fi

grep -q "^`echo $PRELINK | sed 's/ .*$/: .*has a dependency cycle/'`" $BINS.log
tc_fail_if_bad $? "prelink failed on cycle1" || return

# cycle1lib1.so libs are not part of Ubuntu, so excluding this test
grep -i "ubuntu" /etc/*-release >/dev/null 2>&1
Copy link
Contributor

Choose a reason for hiding this comment

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

cycle1lib1.so libs are created for test purpose ? If so this cannot be built for ubuntu ?

if [ $? -ne 0 ];then # Start of OS check
grep -q "^`echo $PRELINK | sed 's/ .*$/: .*has a dependency cycle/'`" $BINS.log
tc_fail_if_bad $? "prelink failed on cycle1" || return
fi

LD_LIBRARY_PATH=. ./$BINS
tc_fail_if_bad $? "Failed to execute the binary" || return
Expand Down