[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4] tools/tests/x86_emulator: avoid duplicate symbol error with clang: use -O0


  • To: Edwin Török <edwin.torok@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 9 Mar 2026 15:15:26 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=80fCUVdzrqGKZAn6+lCyvIb3dy6nmA1vd/zWivUKgGA=; b=f9K4R/leup7uDzOoVoQHyGvqz4rnmgzYh7DY0HWp3set9J55YdR3HqntDqHd3LB5HB0fuSyy+jJJ4YR//giBj7j4jWWS9HP63v+k9y1MB/at+Z6lBn/dZ963W6iTgaUXVGWp5a27pBs78ne+vqw3nVwXAH0YNknuZevnn/CO13yoOxTZXNmbOR8LewBuyVqd2Fom6wADDCFu1Dbu+fOw/t20C4Q87xU+V4i0oJ3biJAVwquYNJ1UhWvqutTnIO16ydXvqN7ZBqdlFR5zrols/kBV0hbshcl96/OG0xOGu8lfvDNfHEz6owUWwO+z2mdEIpW0QnsKMMSqjazaDVcbCw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fUVf/R6q+LHYBCiF9piyj1uuWEH+7m3ElnZjC4Eokc9jq2xwdcUxjT3DJ0HkbDS+JUpz7mJzxjzyXDPWoTAKpTJINOzI6EtyT0ewa9qFxhVpjkM7kYrfkEViD3jCoIjEqezi/LVXQLfduW29eJT7M/WLDAXNOZ1Zhxboo478vfJfhXwLdBQwfJtfgJ/ULKyD9C38F/2qCPboY9oipwYe2J3LZ3HwZoP67tZ8qqBKj0+XoOYEDUZLfNzwOcI9XY/JfETnbYOGqWJQwdYfYf5Ej6H58a7ABLn+rbzJ35FzV0nwvyTn+9Yle3AqGW6gL5aQ3liCzDnrA3eiTWK48/F97w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Mon, 09 Mar 2026 14:15:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Mar 09, 2026 at 10:41:35AM +0000, Edwin Török wrote:
> clang would duplicate the loop body and end up with a double definition
> of the symbol:
> ```
> /tmp/test_x86_emulator-0f3576.s:27823: Error: symbol `vmovsh_to_mem' is 
> already defined
> /tmp/test_x86_emulator-0f3576.s:27825: Error: symbol `.Lvmovsh_to_mem_end' is 
> already defined
> ```
> 
> Until a better solution is found: reduce optimizations in the test runner.
> 
> Using -Os might also work, but we can't rely on the size optimization
> always avoiding the duplication of asm blocks.
> This is test code, not performance critical code, and -O0 is more future
> proof.
> However for debugging -Og is recommended over -O0, and this still
> avoids the duplicate label problem.
> 
> Signed-off-by: Edwin Török <edwin.torok@xxxxxxxxxx>

Building the x86 emulator test harness is currently gated on:

ifneq ($(clang),y)
SUBDIRS-$(CONFIG_X86) += x86_emulator
endif

So I think there should be a further patch (or done here) that removed
this check.  And then we should also run the test harness from one of
the LLVM FreeBSD builds ideally.

Have you tested with a full LLVM based toolchain (so also using LLVM
linker?)

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.