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

Build fails on armv7l (32 bit) #211

Open
goldstar611 opened this issue Dec 29, 2022 · 2 comments
Open

Build fails on armv7l (32 bit) #211

goldstar611 opened this issue Dec 29, 2022 · 2 comments

Comments

@goldstar611
Copy link

While compiling on 32-bit Raspbian OS the following error causes the build to fail:

mnt.cc: In function ‘const string mnt::flagsToStr(long unsigned int)’:
mnt.cc:93:2: error: narrowing conversion of ‘18446744071562067968’ from ‘uint64_t’ {aka ‘long long unsigned int’} to ‘long unsigned int’ inside { } [-Wnarrowing]
  };
  ^
make: *** [Makefile:60: mnt.o] Error 1
make: *** Waiting for unfinished jobs....

nsjail/mnt.cc

Lines 90 to 93 in c7c0adf

#if defined(MS_NOUSER)
NS_VALSTR_STRUCT(MS_NOUSER),
#endif /* defined(MS_NOUSER) */
};

@goldstar611
Copy link
Author

Replacing MS_NOUSER with 1<<31 allows the build to proceed without error.

@rorynugent
Copy link

diff --git a/mnt.cc b/mnt.cc
index 1a9835a..8abd66a 100644
--- a/mnt.cc
+++ b/mnt.cc
@@ -88,7 +88,7 @@ static const std::string flagsToStr(unsigned long flags) {
            NS_VALSTR_STRUCT(MS_ACTIVE),
 #endif /* defined(MS_ACTIVE) */
 #if defined(MS_NOUSER)
-           NS_VALSTR_STRUCT(MS_NOUSER),
+           NS_VALSTR_STRUCT(1<<31),
 #endif /* defined(MS_NOUSER) */
        };

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