Skip to content

Commit 16431da

Browse files
nyuriktgross35
authored andcommitted
Modify QNX NTO platform support
Modify QNX NTO `dl_iterate_phdr` to toke `* mut` All other platforms use `* mut`, and while this is technically a breaking change, most likely noone is using it directly. NTO does not define last four fields of the `dl_phdr_info`, so might as well exclude them for cleanliness. v7.0: [link](https://www.qnx.com/developers/docs/7.0.0/index.html#com.qnx.doc.neutrino.lib_ref/topic/d/dl_iterate_phdr.html) v7.1: [link](https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/d/dl_iterate_phdr.html) v8.0: [link](https://www.qnx.com/developers/docs/8.0/com.qnx.doc.neutrino.lib_ref/topic/d/dl_iterate_phdr.html?hl=dl_phdr_info) See also rust-lang/backtrace-rs#648 (backport <rust-lang#3815>) (cherry picked from commit 4edd266)
1 parent 98f13d9 commit 16431da

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/unix/linux_like/linux/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,14 @@ s! {
327327
// to false. So I'm just removing these, and if uClibc changes
328328
// the #if block in the future to include the following fields, these
329329
// will probably need including here. tsidea, skrap
330-
#[cfg(not(target_env = "uclibc"))]
330+
// QNX (NTO) platform does not define these fields
331+
#[cfg(not(any(target_env = "uclibc", target_os = "nto")))]
331332
pub dlpi_adds: ::c_ulonglong,
332-
#[cfg(not(target_env = "uclibc"))]
333+
#[cfg(not(any(target_env = "uclibc", target_os = "nto")))]
333334
pub dlpi_subs: ::c_ulonglong,
334-
#[cfg(not(target_env = "uclibc"))]
335+
#[cfg(not(any(target_env = "uclibc", target_os = "nto")))]
335336
pub dlpi_tls_modid: ::size_t,
336-
#[cfg(not(target_env = "uclibc"))]
337+
#[cfg(not(any(target_env = "uclibc", target_os = "nto")))]
337338
pub dlpi_tls_data: *mut ::c_void,
338339
}
339340

src/unix/nto/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3340,7 +3340,10 @@ extern "C" {
33403340
pub fn dl_iterate_phdr(
33413341
callback: ::Option<
33423342
unsafe extern "C" fn(
3343-
info: *const dl_phdr_info,
3343+
// The original .h file declares this as *const, but for consistency with other platforms,
3344+
// changing this to *mut to make it easier to use.
3345+
// Maybe in v0.3 all platforms should use this as a *const.
3346+
info: *mut dl_phdr_info,
33443347
size: ::size_t,
33453348
data: *mut ::c_void,
33463349
) -> ::c_int,

0 commit comments

Comments
 (0)