Skip to content

Passing parameters to the C compiler in iconc #628

Open

Description

@marcespie

I'm experimenting with this: simply put, generate param.c straight from configure, and add the set of compiler/linker options that were deduced by configure

then you just need to #include "param.c" at the right location in ccomp.c

This does actively get rid of most of the special cases (hello MacOS) having to do with paths not being taken into account, or stuff like -rdynamic not having the right name.

This could easily be extended to figure out appropriate -Wno-* options to remove warnings for auto-generated code.

The diff is more like a proof of concept for future work.

This allowed me to remove a lot of hand-made dirty stuff to make iconc work on OpenBSD.

@ryandesign , this will probably interest you a lot.

diff9.txt

Activity

  1. marcespie commented on Jul 16, 2026

    @marcespie
    Author

    (if you find the inclusion of a .c in another one disgusting, you could always do a param.h file with just #define for those parameters, and then add the growcat directly into ccomp.c)

  2. marcespie commented on Jul 16, 2026

    @marcespie
    Author

    So I plain forgot I needed to put spaces around parameters in my command line, leading to iconc outrageously failing.

    I've also added supplementary warning flags to silence iconc. It's comparatively trivial: you just define a new SUBST variable ICONCCFLAGS and add to it when you find the -Wno-* flag you want.

    diff9bis.txt

  3. Jafaral commented on Jul 16, 2026

    @Jafaral
    Member

    Can you please open PRs instead of submitting code as diffs?

  4. marcespie commented on Jul 16, 2026

    @marcespie
    Author

    That specific issue needs some discussing before it can even become an actual PR.

    I was raised on diffs and emails, and I actually find it way more convenient to work with than github PRs...

  5. marcespie commented on Jul 16, 2026

    @marcespie
    Author

    but I'll try to do at least a basic PR to let most of unicon compile on OpenBSD systems.

  6. Jafaral commented on Jul 17, 2026

    @Jafaral
    Member

    What is your environment and how are you compiling? The readme file has a small section for BSD systems, see

    https://github.com/uniconproject/unicon#bsd

    Unicon already works on FreeBSD, and it is part of the test platforms we have test coverage for:

    https://github.com/uniconproject/unicon/actions/runs/29460183761/job/87501835177

    If you open a PR, then all tests will be run automatically to validate the changes on all supported platforms including FreeBSD.

  7. Jafaral commented on Jul 17, 2026

    @Jafaral
    Member

    @marcespie , Thanks again for doing these fixes and supplying patches. I did create a PR off of every issue you included a patch with. those PRs are linked to their issues, please review and let me know if I missed anything.

  8. marcespie commented on Jul 18, 2026

    @marcespie
    Author

    Wow, thank you very much. I was slowly getting geared to doing similar stuff

  9. marcespie commented on Jul 18, 2026

    @marcespie
    Author

    I will probably wait until some of these are merged before I push forward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions