564
564
end
565
565
566
566
@testset " Auditor - other checks" begin
567
+ platform = Platform (" armv7l" , " linux" ; call_abi = " eabihf" , libc = " glibc" )
567
568
mktempdir () do build_path
568
- @test_logs (:error , r" does not match the hard-float ABI" ) match_mode= :any begin
569
+ build_output_meta = @test_logs (:error , r" libsoft.so does not match the hard-float ABI" ) match_mode= :any begin
569
570
autobuild (
570
571
build_path,
571
572
" hard_float_ABI" ,
@@ -575,19 +576,45 @@ end
575
576
# Build a library which doesn't link to the standard library and
576
577
# forces the soft-float ABI
577
578
raw """
578
- mkdir -p "${libdir}"
579
- echo 'int _start() { return 0; }' | /opt/${target}/bin/${target}-gcc -nostdlib -shared -mfloat-abi=soft -o "${libdir}/libfoo.${dlext}" -x c -
579
+ mkdir -p "${libdir}" "${bindir}"
580
+ # This library has hard-float ABI
581
+ echo 'int test() { return 0; }' | cc -shared -fPIC -o "${libdir}/libhard.${dlext}" -x c -
582
+ # This library has soft-float ABI
583
+ echo 'int _start() { return 0; }' | /opt/${target}/bin/${target}-gcc -nostdlib -shared -mfloat-abi=soft -o "${libdir}/libsoft.${dlext}" -x c -
584
+ # hello_world built by Go doesn't specify any float ABI
585
+ make -C /usr/share/testsuite/go/hello_world/
586
+ cp "/tmp/testsuite/${target}/go/hello_world/hello_world" "${bindir}/hello_world"
580
587
""" ,
581
588
# Build for Linux armv7l hard-float
582
- [Platform ( " armv7l " , " linux " ; call_abi = " eabihf " , libc = " glibc " ) ],
589
+ [platform ],
583
590
# Ensure our library product is built
584
- [LibraryProduct (" libfoo" , :libfoo )],
591
+ [
592
+ LibraryProduct (" libhard" , :libhard ),
593
+ LibraryProduct (" libsoft" , :libsoft ),
594
+ ExecutableProduct (" hello_world" , :hello_world ),
595
+ ],
585
596
# No dependencies
586
597
Dependency[];
598
+ compilers = [:c , :go ],
587
599
verbose = true ,
588
600
require_license = false
589
601
)
590
602
end
603
+
604
+ @test haskey (build_output_meta, platform)
605
+ tarball_path, tarball_hash = build_output_meta[platform][1 : 2 ]
606
+ @test isfile (tarball_path)
607
+
608
+ # Unpack it somewhere else
609
+ @test verify (tarball_path, tarball_hash)
610
+ testdir = joinpath (build_path, " testdir" )
611
+ mkdir (testdir)
612
+ unpack (tarball_path, testdir)
613
+ # Remove libsoft.so, we want to run audit only on the other products
614
+ rm (joinpath (testdir, " lib" , " libsoft.so" ))
615
+ # Make sure `hello_world` passes the float ABI check even if it doesn't
616
+ # set `EF_ARM_ABI_FLOAT_HARD`.
617
+ @test Auditor. audit (Prefix (testdir); platform= platform, require_license= false )
591
618
end
592
619
end
593
620
0 commit comments