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

nnn-1.5: error when compiling to musl-based systems #45

Closed
maxice8 opened this issue Oct 5, 2017 · 7 comments · Fixed by #46
Closed

nnn-1.5: error when compiling to musl-based systems #45

maxice8 opened this issue Oct 5, 2017 · 7 comments · Fixed by #46

Comments

@maxice8
Copy link
Contributor

maxice8 commented Oct 5, 2017

Trying to compile and cross-compile musl-based systems causes the following error

==> nnn_x86_64-musl_do_build.log
x86_64-linux-musl-gcc -specs=/void-packages/common/environment/configure/gccspecs/hardened-cc1  -fstack-protector-strong -D_FORTIFY_SOURCE=2  -O2 -pipe -mtune=generic   -I/usr/x86_64-linux-musl/usr/include -o nnn nnn.c -specs=/void-packages/common/environment/configure/gccspecs/hardened-ld -Wl,-z,relro -Wl,-z,now -Wl,--as-needed     -L/usr/x86_64-linux-musl/usr/lib -lreadline -lncursesw
nnn.c:203:2: error: unknown type name ‘ushort’
  ushort filtermode : 1;  /* Set to enter filter mode */
  ^~~~~~
nnn.c:204:2: error: unknown type name ‘ushort’
  ushort mtimeorder : 1;  /* Set to sort by time modified */
  ^~~~~~
nnn.c:205:2: error: unknown type name ‘ushort’
  ushort sizeorder  : 1;  /* Set to sort by file size */
  ^~~~~~
nnn.c:206:2: error: unknown type name ‘ushort’
  ushort blkorder   : 1;  /* Set to sort by blocks used (disk usage) */
  ^~~~~~
nnn.c:207:2: error: unknown type name ‘ushort’
  ushort showhidden : 1;  /* Set to show hidden files */
  ^~~~~~
nnn.c:208:2: error: unknown type name ‘ushort’
  ushort showdetail : 1;  /* Clear to show fewer file info */
  ^~~~~~
nnn.c:209:2: error: unknown type name ‘ushort’
  ushort showcolor  : 1;  /* Set to show dirs in blue */
  ^~~~~~
nnn.c:210:2: error: unknown type name ‘ushort’
  ushort dircolor   : 1;  /* Current status of dir color */
  ^~~~~~
nnn.c:211:2: error: unknown type name ‘ushort’
  ushort metaviewer : 1;  /* Index of metadata viewer in utils[] */
  ^~~~~~
nnn.c:212:2: error: unknown type name ‘ushort’
  ushort color      : 3;  /* Color code for directories */
  ^~~~~~
make: *** [Makefile:26: nnn] Error 1

adding #include <sys/types.h> to nnn.c seems to fix the problem with ushort and compilation ( and cross-compilation ) works correctly

@jarun
Copy link
Owner

jarun commented Oct 5, 2017

Please raise the PR.

Also, are you stuck on a release because of this? I that case I can do a minor release for you this afternoon. Otherwise, it will be in master till the next release.

Thanks for reporting it!

@maxice8
Copy link
Contributor Author

maxice8 commented Oct 5, 2017

Please raise the PR.

sorry but my "quick solution ( read hackish solution)" was simply adding #include <sys/types.h> to the top which i have no clue if it breaks any of the other platforms supported ( The *BSDs and OSX )

Also, are you stuck on a release because of this? I that case I can do a minor release for you this afternoon. Otherwise, it will be in master till the next release.

It can certainly be patched to build but it's much preferred to follow upstream, if upstream releases a fix ( either as a commit that can be picked as a patch or a minor release that can be bumped to ) all the better.

Thanks for reporting it!

Thanks for attention

@jarun
Copy link
Owner

jarun commented Oct 5, 2017

i have no clue if it breaks any of the other platforms supported

Travis CI takes care of this for nnn.

Also,
are you stuck on a release because of this?

@maxice8
Copy link
Contributor Author

maxice8 commented Oct 5, 2017

are you stuck on a release because of this?

No

@maxice8
Copy link
Contributor Author

maxice8 commented Oct 5, 2017

Sent a PR to try to fix.

@jarun jarun closed this as completed in #46 Oct 5, 2017
@jarun
Copy link
Owner

jarun commented Mar 15, 2018

@maxice8 musl-libc compilation is now integrated on Travis CI.

@maxice8
Copy link
Contributor Author

maxice8 commented Mar 15, 2018 via email

@lock lock bot locked and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants