Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1757548

Summary: program written for rust doesn't compile on ppc64le
Product: [Fedora] Fedora Reporter: Steve Grubb <sgrubb>
Component: rustAssignee: Rust SIG <rust-sig>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 33CC: bugproxy, dan, igor.raits, jistone, rust-sig, spectre, TicoTimo
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1071880    

Description Steve Grubb 2019-10-01 19:27:42 UTC
When compiling a program written for rust on ppc64le, I get the following error:

Description of problem:
  = note: /usr/bin/ld: /builddir/build/BUILD/suricata-5.0.0-rc1/rust/target/debug/deps/suricata-e6597667108d11ec.2kpivclfzlxj8xrv.rcgu.o: in function `suricata::json::Json::object':
          /builddir/build/BUILD/suricata-5.0.0-rc1/rust/src/json.rs:54: undefined reference to `json_object'
          /usr/bin/ld: /builddir/build/BUILD/suricata-5.0.0-rc1/rust/target/debug/deps/suricata-e6597667108d11ec.2kpivclfzlxj8xrv.rcgu.o: in function `suricata::json::Json::array':
          /builddir/build/BUILD/suricata-5.0.0-rc1/rust/src/json.rs:60: undefined reference to `json_array'
          /usr/bin/ld: /builddir/build/BUILD/suricata-5.0.0-rc1/rust/target/debug/deps/suricata-e6597667108d11ec.2kpivclfzlxj8xrv.rcgu.o: in function `suricata::json::Json::set':
          /builddir/build/BUILD/suricata-5.0.0-rc1/rust/src/json.rs:82: undefined reference to `json_object_set_new'
          /usr/bin/ld: /builddir/build/BUILD/suricata-5.0.0-rc1/rust/target/debug/deps/suricata-e6597667108d11ec.2kpivclfzlxj8xrv.rcgu.o: in function `suricata::json::Json::set_string':
          /builddir/build/BUILD/suricata-5.0.0-rc1/rust/src/json.rs:100: undefined reference to `json_string'
          /usr/bin/ld: /builddir/build/BUILD/suricata-5.0.0-rc1/rust/src/json.rs:98: undefined reference to `json_object_set_new'
          /usr/bin/ld: /builddir/build/BUILD/suricata-5.0.0-rc1/rust/target/debug/deps/suricata-e6597667108d11ec.2kpivclfzlxj8xrv.rcgu.o: in function `suricata::json::Json::set_integer':
          /builddir/build/BUILD/suricata-5.0.0-rc1/rust/src/json.rs:108: undefined reference to `json_integer'
          /usr/bin/ld: /builddir/build/BUILD/suricata-5.0.0-rc1/rust/src/json.rs:106: undefined reference to `json_object_set_new'
          /usr/bin/ld: /builddir/build/BUILD/suricata-5.0.0-rc1/rust/target/debug/deps/suricata-e6597667108d11ec.2kpivclfzlxj8xrv.rcgu.o: in function `suricata::json::Json::array_append_string':
          /builddir/build/BUILD/suricata-5.0.0-rc1/rust/src/json.rs:127: undefined reference to `json_string'
          /usr/bin/ld: /builddir/build/BUILD/suricata-5.0.0-rc1/rust/src/json.rs:127: undefined reference to `json_array_append_new'
          collect2: error: ld returned 1 exit status
          
error: aborting due to previous error
error: Could not compile `suricata`.

This compiles fine on other arches. I'm wondering if something is missing on the ppc64le that other arches have. This is against the rawhide version.

How reproducible:
Every time

Steps to Reproduce:
1. Build rawhide version of suricata on ppc64le system


Actual results:
https://kojipkgs.fedoraproject.org//work/tasks/8303/37988303/build.log

Comment 1 Josh Stone 2019-10-01 19:47:18 UTC
Those symbols are supposed to be provided by libjansson, right? I don't see -ljansson on the link line.

But this is only in "cargo test" -- are the Json functions not involved in testing? Perhaps other arches are doing a better job of pruning this?

Comment 2 Josh Stone 2019-10-01 22:03:53 UTC
I reproduced this with rust-1.37.0-1.fc30.ppc64le + llvm-libs-8.0.0-6.fc30.ppc64le, so the problem is not rawhide's newer toolchain.

It works if I add a link attribute in src/json.rs:

/// Expose the jansson functions we need.
#[link(name = "jansson")]
extern {
    fn json_object() -> *mut JsonT;
    ...
}

Comment 3 Steve Grubb 2019-10-03 20:39:05 UTC
I did a new build that let's all arches finish instead of fail-fast:
https://koji.fedoraproject.org/koji/taskinfo?taskID=38039091

ppc64le is the only one failing. I wonder if something is different on that platform?

Comment 4 Cameron Kaiser 2019-10-17 22:30:24 UTC
Could this be related to bug 1756838?

Comment 5 Ben Cotton 2020-02-11 17:51:15 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 6 Dan Horák 2020-05-05 09:13:11 UTC
The problem is still in Rawhide.

Josh, what component needs to be fixed? Is it rust, libjansson or something else? Where your workaround should go in?

Comment 7 Josh Stone 2020-05-05 19:49:00 UTC
(In reply to Dan Horák from comment #6)
> The problem is still in Rawhide.
> 
> Josh, what component needs to be fixed? Is it rust, libjansson or something
> else? Where your workaround should go in?

That was in suricata's src/json.rs, and in fact I think that's correct to require, not just a workaround.
(But I still don't really know why only ppc64le is affected.)

Comment 8 Ben Cotton 2020-08-11 15:20:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.