Skip to content

Commit

Permalink
[config] Fix cpu config values for gcc_cmpxchg #1173
Browse files Browse the repository at this point in the history
On amd64 atomic/gcc_x86.o is now included.
The HAS_\U${platform}_$feature config hash entries are now harmonized.
  • Loading branch information
Reini Urban committed Jan 18, 2015
1 parent 1d934de commit 0aa83b3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Expand Up @@ -32,6 +32,7 @@
+ Fix and allow --cxx on FreeBSD 10 (clang, not g++) #1166
+ Fix git_describe config probe on tag-less repos, e.g. git clone --depth #1167
+ Fix solaris asctime_r with _POSIX_C_SOURCE #858
+ Fix cpu config values for gcc_cmpxchg to include atomic/gcc_x86.o on amd64 #1173
- Documentation
- Tests
- Community
Expand Down
12 changes: 7 additions & 5 deletions config/auto/cpu/amd64/auto.pm
@@ -1,4 +1,4 @@
# Copyright (C) 2004-2014, Parrot Foundation.
# Copyright (C) 2004-2015, Parrot Foundation.

=head1 NAME
Expand All @@ -18,15 +18,17 @@ use warnings;
sub runstep {
my ( $self, $conf ) = @_;

# x86_64 on gcc has cmpxchg
# AMD64 on gcc has cmpxchg
my $gcc = $conf->data->get('gccversion');
$conf->debug("gccversion: $gcc\n");
if ( defined $gcc ) {
# HAS_foo defines PARROT_HAS_`uc foo`
$conf->data->set(
"HAS_I386_GCC_CMPXCHG" => '1',
"HAS_X86_64_GCC_CMPXCHG" => '1',
"HAS_I386_gcc_cmpxchg" => '1',
"HAS_AMD64_gcc_cmpxchg" => '1',
);
}
$conf->debug(" (gcc_cmpxchg)\n");
}
}

1;
Expand Down
13 changes: 6 additions & 7 deletions config/auto/cpu/i386/auto.pm
@@ -1,14 +1,14 @@
# Copyright (C) 2001-2013, Parrot Foundation.
# Copyright (C) 2001-2015, Parrot Foundation.

=head1 NAME
config/auto/cpu/i386/auto.pm
=head1 DESCRIPTION
Test for cmpxchg ASM functionality. Creates these Config entries
Test for cmpxchg ASM functionality. Creates this Config entry:
i386_has_gcc_cmpxchg_c => 1
HAS_I386_gcc_cmpxchg => 1
=cut

Expand All @@ -23,7 +23,7 @@ sub runstep {
my @files = qw( test_gcc_cmpxchg_c.in );
for my $f (@files) {
$conf->debug(" $f ");
my ($suffix) = $f =~ /test_(\w+)/;
my ($suffix) = $f =~ /test_(\w+)_c.in/;
my $path_f = "config/auto/cpu/i386/$f";
$conf->cc_gen($path_f);
eval { $conf->cc_build("-DPARROT_CONFIG_TEST") };
Expand All @@ -44,10 +44,9 @@ sub runstep {
sub _handle_cc_run_ok {
my ($conf, $suffix, $path_f) = @_;
$conf->data->set(
"i386_has_$suffix" => '1',
"HAS_i386_$suffix" => '1',
"HAS_I386_$suffix" => '1',
);
$conf->debug(" (\U$suffix) ");
$conf->debug(" ($suffix) ");
}

1;
Expand Down
2 changes: 1 addition & 1 deletion config/gen/makefiles/root.in
Expand Up @@ -458,7 +458,7 @@ IO_O_FILES = \
INTERP_O_FILES = \
src/string/api$(O) \
src/ops/core_ops$(O) \
#IF(i386_has_gcc_cmpxchg): src/atomic/gcc_x86$(O) \
#IF(HAS_I386_gcc_cmpxchg): src/atomic/gcc_x86$(O) \
src/core_pmcs$(O) \
src/datatypes$(O) \
src/debug$(O) \
Expand Down

0 comments on commit 0aa83b3

Please sign in to comment.