xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Martin Pohlack <mpohlack@amazon.com>,
	Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Keir Fraser <keir@xen.org>, Tim Deegan <tim@xen.org>
Subject: Re: [PATCH v2 3/5] x86/mm: override stored file names for multiply built sources
Date: Mon, 26 Oct 2015 14:57:11 +0000	[thread overview]
Message-ID: <562E3F47.4010407@citrix.com> (raw)
In-Reply-To: <562E39FC.3000409@amazon.com>

On 26/10/15 14:34, Martin Pohlack wrote:
> On 26.10.2015 12:51, Jan Beulich wrote:
>> To make it possible to tell apart the static symbols therein, use their
>> object file names instead of their source ones.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> v2: Introduce __OBJECT_FILE__.
>>
>> --- a/xen/Rules.mk
>> +++ b/xen/Rules.mk
>> @@ -42,10 +42,10 @@ ALL_OBJS-y               += $(BASEDIR)/x
>>  ALL_OBJS-y               += $(BASEDIR)/arch/$(TARGET_ARCH)/built_in.o
>>  ALL_OBJS-$(x86)          += $(BASEDIR)/crypto/built_in.o
>>  
>> -CFLAGS += -fno-builtin -fno-common
>> +CFLAGS += -nostdinc -fno-builtin -fno-common
>>  CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
>>  CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
>> -CFLAGS += -nostdinc
>> +CFLAGS += '-D__OBJECT_FILE__="$@"'
>>  
>>  CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
>>  CFLAGS-$(FLASK_ENABLE)  += -DFLASK_ENABLE
>> --- a/xen/arch/x86/mm/guest_walk.c
>> +++ b/xen/arch/x86/mm/guest_walk.c
>> @@ -21,6 +21,9 @@
>>   * along with this program; If not, see <http://www.gnu.org/licenses/>.
>>   */
>>  
>> +/* Allow uniquely identifying static symbols in the 3 generated objects. */
>> +asm(".file \"" __OBJECT_FILE__ "\"");
>> +
> 
> I wonder if using symlinks to the C files and compiling those would be a
> more obvious way to set the file symbol to something unique.

That's an interesting idea.  My initial reactions:

1. Setting up the runes and such to make those links wouldn't be simpler
than the asm()-ery that Jan has here

2. Having random linked files lying around has the potential to cause
other forms of confusion (git needs to know to ignore them; developers
may not realize that editing one edits all the others, &c; even if they
do, they may accidentally open two files in an editor that doesn't
realize they're the same file, &c)

 -George

  reply	other threads:[~2015-10-26 14:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-26 10:47 [PATCH v2 0/5] disambiguate symbol names (part 2) Jan Beulich
2015-10-26 11:49 ` [PATCH v2 1/5] symbols: prefix static symbols with their source file names Jan Beulich
2015-10-28 12:55   ` Andrew Cooper
2015-10-28 13:25     ` Jan Beulich
2015-10-28 13:42       ` Andrew Cooper
2015-10-28 14:29         ` Jan Beulich
2015-11-02 13:47   ` Ian Campbell
2015-11-02 13:55     ` Jan Beulich
2015-11-02 14:54       ` Ian Campbell
2015-11-02 14:58         ` Jan Beulich
2015-11-02 15:11           ` Ian Campbell
2015-10-26 11:50 ` [PATCH v2 2/5] compat: enforce distinguishable file names in symbol table Jan Beulich
2015-10-28 13:08   ` Andrew Cooper
2015-11-02 15:20   ` Ian Campbell
2015-11-02 16:11     ` Jan Beulich
2015-11-03 12:22       ` Ian Campbell
2015-11-03 12:50         ` Jan Beulich
2015-11-03 13:39           ` Ian Campbell
2015-11-03 15:31             ` Jan Beulich
2015-11-03 15:42               ` Ian Campbell
2015-10-26 11:51 ` [PATCH v2 3/5] x86/mm: override stored file names for multiply built sources Jan Beulich
2015-10-26 12:52   ` Andrew Cooper
2015-10-26 14:34   ` Martin Pohlack
2015-10-26 14:57     ` George Dunlap [this message]
2015-10-26 15:12       ` Jan Beulich
2015-10-26 16:27   ` George Dunlap
2015-10-26 11:52 ` [PATCH v2 4/5] x86/mm: build map_domain_gfn() just once Jan Beulich
2015-10-26 12:52   ` Andrew Cooper
2015-10-26 14:58   ` George Dunlap
2015-10-26 11:53 ` [PATCH v2 5/5] x86/mm: only a single instance of gw_page_flags[] is needed Jan Beulich
2015-10-26 14:59   ` George Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=562E3F47.4010407@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=keir@xen.org \
    --cc=mpohlack@amazon.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).