From: Philippe Waroquiers Date: Wed, 1 Apr 2015 20:05:50 +0000 (+0000) Subject: Improve comments, add the copyright notice X-Git-Tag: svn/VALGRIND_3_11_0^2~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ab6e75dbb2d95461dd2ea3d371a92943e271a98;p=thirdparty%2Fvalgrind.git Improve comments, add the copyright notice git-svn-id: svn://svn.valgrind.org/vex/trunk@3115 --- diff --git a/VEX/priv/multiarch_main_main.c b/VEX/priv/multiarch_main_main.c index 8991e4525e..f2f2ed2c97 100644 --- a/VEX/priv/multiarch_main_main.c +++ b/VEX/priv/multiarch_main_main.c @@ -1,2 +1,69 @@ +/*---------------------------------------------------------------*/ +/*--- Begin multiarch_main_main.c ---*/ +/*---------------------------------------------------------------*/ + +/* + This file is part of Valgrind, a dynamic binary instrumentation + framework. + + Copyright (C) 2015 Philippe Waroquiers + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + + The GNU General Public License is contained in the file COPYING. + + Neither the names of the U.S. Department of Energy nor the + University of California nor the names of its contributors may be + used to endorse or promote products derived from this software + without prior written permission. +*/ + +/* This file is used to have main_main.c compiled with VEXMULTIARCH + defined, so that all host and guest arch are callable from LibVEX_Translate + and other functions defined in main_main.c. + The resulting object file will be put in libvexmultiarch--os>.a. + + The valgrind tools are making the assumption that host and guest are + the same. So, no need to drag the full set of archs when + linking a tool. + The VEX library is nicely split in arch independent and arch dependent + objects. Only main_main.c is dragging the various arch specific files. + So, main_main.c (the main entry point of the VEX library) is compiled + only for the current guest/host arch. + + This file ensures we recompile main_main.c with all archs activated. + + So, a VEX user can decide (at link time) to use a 'single arch' VEX lib, + or to use a multiarch VEX lib. + If t1.o is a 'main' that calls LibVEX_Translate, then + to link with a single arch VEX lib, use e.g. the following : + gcc -o t1single t1.o -LInst/lib/valgrind -lvex-amd64-linux -lgcc + + to link with a multi arch VEX lib, you must insert + -lvexmultiarch-amd64-linux *before* -lvex-amd64-linux + i.e; + gcc -o t1multi t1.o \ + -LInst/lib/valgrind -lvexmultiarch-x86-linux -lvex-amd64-linux -lgcc + + t1single will only be able to translate from amd64 to amd64. + t1multi will be able to translate from any arch supported by VEX + to any other arch supported by VEX. + Note however that multiarch support is experimental and poorly + or not tested. +*/ + #define VEXMULTIARCH 1 #include "main_main.c"