Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying --prefix when cross-compiling #56

Closed
firasuke opened this issue Sep 11, 2022 · 9 comments
Closed

Specifying --prefix when cross-compiling #56

firasuke opened this issue Sep 11, 2022 · 9 comments

Comments

@firasuke
Copy link
Contributor

Hey there,

I've encountered an error recently where attempting to cross-compile bc while using CC as the cross compiler and HOSTCC as the compiler and when passing --prefix=/usr as a configuration flag.

It appears that bc is searching for header files in $PREFIX/include, although the help message mentions that these options control the installation directories of bc files and not the directories header/library files are searched for.

The error disappears when I remove the --prefix=/usr flag and the installation defaults to /usr/local as there's no way to change it because --prefix causes an error.

The error is:

     /usr/include/bits/types/time_t.h:8:9: error: unknown type name '__time64_t'
    8 | typedef __time64_t time_t;
      |         ^~~~~~~~~~

I don't recall changing the configuration flags I use for bc since version 4.0, did the behavior of these flags change?

Thanks in advance!

@gavinhoward
Copy link
Owner

This looks like a bug in configure.sh. However, I need to know now to track it down.

Can you tell me what the host system is, what the target system is, what the host compiler is, and what the target compiler is?

@firasuke
Copy link
Contributor Author

firasuke commented Sep 12, 2022

The host system architecture tuple is x86_64-unknown-linux-gnu and the target architecture tuple is x86_64-linux-musl.

The host compiler HOSTCC=gcc and the target compiler is CC=x86_64-linux-musl-gcc.

@firasuke
Copy link
Contributor Author

I thought this will might help narrow down the cause.

The last known working version that I tried using the same configuration flags and recipe file is version 5.2.5, so my guess would be that the change happened after that release, possibly with the latest 6.0 release.

@firasuke
Copy link
Contributor Author

I think I found the faulty commit.

firasuke referenced this issue Sep 12, 2022
Signed-off-by: Gavin Howard <gavin@yzena.com>
@gavinhoward
Copy link
Owner

I think you did too.

That commit appears to have been made as exploration; I should have added more to the commit message. Nevertheless, it appears to not be necessary anymore because I tested the FreeBSD port without those changes, and it worked fine.

So I committed 2b65eb2 to erase the rest of that commit. Can you pull and test it?

@firasuke
Copy link
Contributor Author

I can confirm that this indeed 2b65eb2 fixed the issue.

Can you release this fix in a new bugfix version?

@gavinhoward
Copy link
Owner

Wonderful!

I'll release a bug fix version as soon as I have confirmation that this fix does not break FreeBSD. I hope that will be soon.

@gavinhoward
Copy link
Owner

Release 6.0.3 is out. I hope it fixes your issue.

If it doesn't, please feel free to reopen.

@firasuke
Copy link
Contributor Author

Yup, the new release solved the issue.

Thanks for your time and effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants