-
Notifications
You must be signed in to change notification settings - Fork 273
Enable goto-cc to build and link Xen #1357
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
Conversation
cd6f379
to
a550377
Compare
a550377
to
eead8d7
Compare
Marking do-not-merge as it is an unhealthy mix of different bugfixes. Yet it makes a Xen build succeed when using the following script: #!/usr/bin/env bash
# this should reproduce the compilation problem with goto-gcc on upstream Xen
set -e
# tested on Ubuntu 14.04
sudo apt-get install bcc python-dev uuid-dev libaio-dev libyajl-dev
# get upstream xen, move to staging branch
if [ ! -d xen.git ]
then
git clone git://xenbits.xen.org/xen.git xen.git
fi
cd xen.git
git checkout staging
# the following patch is required to work around embedded-C problems
#--- a/xen/Makefile
#+++ b/xen/Makefile
#@@ -189,7 +189,7 @@ include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
# echo "#ifndef __ASM_OFFSETS_H__"; \
# echo "#define __ASM_OFFSETS_H__"; \
# echo ""; \
#- sed -rne "/==>/{s:.*==>(.*)<==.*:\1:; s: [\$$#]: :; p;}"; \
#+ sed -rne "/^[^#].*==>/{s:.*==>(.*)<==.*:\1:; s: [\$$#]: :; p;}"; \
# echo ""; \
# echo "#endif") <$< >$@
#
# install goto-gcc as gcc replacement
mkdir -p hooks
pushd hooks
echo "goto-gcc --native-compiler /usr/bin/gcc \"\$@\"" > gcc
echo "goto-bcc --native-compiler /usr/bin/bcc \"\$@\"" > bcc
echo "goto-g++ --native-compiler /usr/bin/g++ \"\$@\"" > g++
echo "goto-as86 --native-assembler /usr/bin/as86 \"\$@\"" > as86
chmod u+x *
export PATH=$(pwd):$PATH
popd
export PATH=$HOME/cbmc-github.git/src/goto-cc:$HOME/cbmc-github.git/scripts:$PATH
# (re)build xen with goto-gcc as gcc replacement
./configure LD=goto-ld
make xen -j 1 LD=goto-ld |
795ecc9
to
d6079a9
Compare
Running objcopy on EFI binaries does not work, hence we need to give up on the goto-cc sections in a graceful manner.
As long as the bit-width of parameters matches, we should be able to obtain sane results.
d6079a9
to
7a09ada
Compare
Rebased against latest develop to reduce the patch set to those that are specific to Xen (and thus retitled). Keeping do-not-merge as the linker hack is dubious and a full set-up for an integration test should be included (and that test should be performed) -- that test should just use the script posted above. |
Closing as #2557 contains all the necessary fixes. |
No description provided.