PackageTrack
Sign in Get early access

ctor

Global, no_std-compatible constructors for all platforms that run before main (like C/C++ __attribute__((constructor)))

1.0.13 178M downloads/mo #549 most downloaded on crates.io mmastrac/linktime

What this package is like to depend on

Last release 14 days ago

09 Aug 2026

Release timing varies

gaps range from 8 days to 4 months

Some releases are documented

notes for 20 of 78 stable releases

Nothing withdrawn

no release was ever pulled

8 years old

79 releases · first in 2018

29 releases in the last 12 months

see the full history below

Release timeline

79 releases · Dec 2018 to Aug 2026
2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 60 of 79
  1. 1.0.13 09 Aug 2026
    Release notes

    What's Changed

    • Bumped internal proc macro minimum version to pick up consistent 64-bit hash chunks (#508) and the cross-crate section-name fix (#509) (should not result in any downstream visible changes)
    • Document crate_path and re-exports by @mmastrac in #514

    Full Changelog: ctor-1.0.12...ctor-1.0.13

    Open source →
    Release notes

    Changed

    • Bump linktime-proc-macro dependency to 0.2.3 (consistent 64-bit hash chunks and cross-crate section-name fix).

    Documentation

    • Documented the crate_path override for re-exporting the macro from another crate.
    Open source →
  2. 1.0.12 29 Jul 2026
    Release notes

    Changed

    • Bump linktime-proc-macro dependency to 0.2.1 (makes link-section names more stable).
    Open source →
  3. 1.0.11 26 Jul 2026
    Release notes

    Fixed

    • Pointer-align the priority ctor anchor on Apple platforms (#502).
    Open source →
  4. 1.0.10 21 Jul 2026
    Release notes

    Changed

    • Faster atomics and #[cold] for Static::deref initialization (@yvt PR #501)
    Open source →
  5. 1.0.9 16 Jul 2026
    Release notes

    Fixed

    • Ensure the single executing priority ctor is kept alive on Apple platforms (#496).
    Open source →
  6. 1.0.8 06 Jul 2026
    Release notes

    Changed

    • Bump link-section dependency to 0.19.0.
    Open source →
  7. 1.0.7 28 May 2026
    Release notes

    Changed

    • Bump link-section dependency to 0.18.0.
    • Improve error messages for bad attribute values.
    Open source →
  8. 1.0.6 17 May 2026
    Release notes

    Changed

    • Bump link-section dependency to 0.17.0.
    • MSRV bumped to 1.85.0 (if priority feature is enabled), otherwise remains at 1.60.0.
      • To restore MSRV to 1.60.0, use ctor = { version = "1.0.6", default-features = false, features = ["proc_macro", "std"] } in your Cargo.toml.

    Fixed

    • #[ctor] requires significantly less macro recursion.
    Open source →
  9. 1.0.5 11 May 2026
    Release notes

    Changed

    • Repair MSRV breakage for WASM targets.
    Open source →
  10. 1.0.4 09 May 2026
    Release notes

    Added

    • Support for win7, uwp and other windows targets
    • Support for UEFI targets (.init_array matching gnu-efi)
    • Fallback to .init_array for unsupported targets (with a warning)

    Changed

    • target_vendor = "pc" is now target_os = "windows". This should be a strictly increasing set of support for windows targets.
    Open source →
  11. 1.0.3 07 May 2026
    Release notes

    Fixed

    • A default priority value is now supported and is the default. This is equivalent to a priority of 500 on most platforms. The previous priority default of 0 was unsafe for C library access on some platforms.
    • The early priority value is now equivalent to a priority of 101 on most platforms.
    Open source →
  12. 1.0.2 06 May 2026
    Release notes

    Changed

    • Bump link-section dependency to 0.15.0.
    • Use const rather than static items for collected constructors on macOS.
    • Allow various forms of &'static for #[ctor] statics which desugar to &'static Static.
    • Static items delegate Display directly as well.
    • Support for multiple #[ctor] items in a single #[ctor] block:
    #[ctor]
    static CTOR: &[fn()] = const {
      // ...
    }
    
    Open source →
  13. 1.0.1 04 May 2026
    Release notes

    Changed

    • wasm32-unknown-unknown would run ctor items on each call of an exported function.
    Open source →
  14. 1.0.0 03 May 2026
    Release notes

    Changed

    • Stabilized (yay!). Identical to 0.13.1. Thanks to all the contributors who helped along the way! Please file any upgrade issues in https://github.com/mmastrac/linktime/issues.
    • For those upgrading from earlier versions, the major changes for you to note are:
      • dtor was split into the dtor crate. You'll need to add it to your dependencies like so:
        [dependencies]
        dtor = "1.0.0" # or later
        
      • #[ctor(unsafe)] is now required for #[ctor] items. If you are building a binary, you can use RUSTFLAGS="--cfg linktime_no_fail_on_missing_unsafe" (or alternatively, specify this in your config.toml file) to bypass the error.
      • For those re-exporting ctor from their own crates: the ctor::declarative::ctor! macro should be preferred over #[ctor(crate_path = ...)]. The latter form will continue to work, but the declarative macro is far more stable for most use cases. See https://docs.rs/ctor/latest/ctor/declarative/macro.ctor.html for more details.
    Open source →
  15. 0.13.1 02 May 2026
    Release notes

    Changed

    • Crate examples were reorganized.

    Fixed

    • Documentation fixes (--cfg flags were incorrect).
    • Incorrect crate feature in docs.
    Open source →
  16. 0.13.0 02 May 2026
    Release notes

    Changed

    • #[ctor(priority = naked)] is now #[ctor(naked)].
    • unsafe is now required for #[ctor] items and the no_warn_on_missing_unsafe feature is gone.
      • RUSTFLAGS="--cfg linktime_no_fail_on_missing_unsafe" can bypass the error.
    • used_linker feature moved to --cfg linktime_used_linker flag.

    Added

    • Re-added link section option for body of #[ctor] items (supported for Linux/Android/FreeBSD/Apple).
    Open source →
  17. 0.12.0 30 Apr 2026
    Release notes

    Added

    • Support for #[ctor] on impl items. To be valid, the fn must have no self parameter and must not access any generic parameters from the outer item.
    • Added life before main documentation to all crates.
    • early and late priority values are now supported on all platforms.

    Removed

    • Deprecated dtor feature and crate dependency from ctor crate (use the dtor crate directly).

    Fixed

    • AIX uses "standard" priority values from 0 to 999, early and late (mapped to 80000000 to 80000999).

    Changed

    • If the priority feature is enabled, ctor priority sorting is now stable and consistent across platforms: early/0/unspecified, then 1 <= N < 1000, then late.
    • If a link_section or export_name_prefix is specified, a priority value must not be specified (now a compiler error).
    • Migrated to using the linktime-proc-macro crate for proc-macro support.
    Open source →
  18. 0.11.1 28 Apr 2026
    Release notes

    Changed

    • Deprecated dtor macros in favor of the dtor crate.
    • Migrated to using the linktime-proc-macro crate for proc-macro support.

    Fixed

    • Fixed some stray dtor references in ctor docs.
    Open source →
  19. 0.11.0 28 Apr 2026
    Release notes

    Added

    • AIX support for ctor/dtor crates.

    Changed

    • Significant rewrite to ctor/dtor macros and documentation.
    • Macro attributes and crate features are auto-documented.
    • Rewrote statics code in ctor to not require std.
    Open source →
  20. 0.10.1 22 Apr 2026
    Release notes

    Added

    • Included licenses in all files.
    • Bumped proc-macro dependency versions.

    Fixed

    • Fix MSRV in ctor docs.
    • Various hardening fixes under Miri.
    • Adding priority to ctors accidentally enabled the anonymous flag.

    Changed

    • ctor exports all dtor macros from dtor crate rather than reimplementing them.
    Open source →
  21. 0.10.0 13 Apr 2026

    Nothing published for this version

  22. 0.9.1 09 Apr 2026

    Nothing published for this version

  23. 0.9.0 09 Apr 2026

    Nothing published for this version

  24. 0.8.0 28 Mar 2026

    Nothing published for this version

  25. 0.7.0 27 Mar 2026

    Nothing published for this version

  26. 0.6.3 04 Dec 2025

    Nothing published for this version

  27. 0.6.2 02 Dec 2025

    Nothing published for this version

  28. 0.6.1 03 Nov 2025

    Nothing published for this version

  29. 0.6.0 08 Oct 2025

    Nothing published for this version

  30. 0.5.0 10 Aug 2025

    Nothing published for this version

  31. 0.4.3 27 Jul 2025

    Nothing published for this version

  32. 0.4.2 21 Apr 2025

    Nothing published for this version

  33. 0.4.1 09 Mar 2025

    Nothing published for this version

  34. 0.4.0 26 Feb 2025

    Nothing published for this version

  35. 0.3.6 19 Feb 2025

    Nothing published for this version

  36. 0.3.5 18 Feb 2025

    Nothing published for this version

  37. 0.3.4 15 Feb 2025

    Nothing published for this version

  38. 0.3.3 13 Feb 2025

    Nothing published for this version

  39. 0.3.2 13 Feb 2025

    Nothing published for this version

  40. 0.3.1 12 Feb 2025

    Nothing published for this version

  41. 0.3.0 11 Feb 2025

    Nothing published for this version

  42. 0.3.0-beta0 21 Nov 2024 pre-release

    Nothing published for this version

  43. 0.2.9 20 Nov 2024

    Nothing published for this version

  44. 0.2.8 16 Apr 2024

    Nothing published for this version

  45. 0.2.7 26 Feb 2024

    Nothing published for this version

  46. 0.2.6 12 Dec 2023

    Nothing published for this version

  47. 0.2.5 26 Sep 2023

    Nothing published for this version

  48. 0.2.4 13 Jul 2023

    Nothing published for this version

  49. 0.2.3 30 Jun 2023

    Nothing published for this version

  50. 0.2.2 31 May 2023

    Nothing published for this version

  51. 0.2.1 30 May 2023

    Nothing published for this version

  52. 0.2.0 26 Mar 2023

    Nothing published for this version

  53. 0.1.26 19 Oct 2022

    Nothing published for this version

  54. 0.1.25 18 Oct 2022

    Nothing published for this version

  55. 0.1.24 18 Oct 2022

    Nothing published for this version

  56. 0.1.23 28 Jul 2022

    Nothing published for this version

  57. 0.1.22 18 Mar 2022

    Nothing published for this version

  58. 0.1.21 31 Aug 2021

    Nothing published for this version

  59. 0.1.20 23 Mar 2021

    Nothing published for this version

  60. 0.1.19 02 Feb 2021

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive