tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Brute force hack for default MACHINE_ARCH on 64/32 bit NetBSD installations



Hey folks,

I know this is usually handled properly during bootstrap (or so I guess at
least) - but on NetBSD, especially the variants running with 32bit userland
on 64 bit kernels by default, like mips64, the below patch would help
to make things work out of the box.

I am trying to get a EdgeRouter Lite to work properly currently (planning
to add it to the regular test runs), and this is one of the first show
stoppers:

Warning: package `digest-20121220' was built for a platform:
NetBSD/mipseb 7.99.16 (pkg) vs. NetBSD/mips64eb 7.99.16 (this host)
pkg_add: 1 package addition failed

... after locally building a pkg.

Are there better solutions?

Martin

Index: perform.c
===================================================================
RCS file: /cvsroot/src/external/bsd/pkg_install/dist/add/perform.c,v
retrieving revision 1.4
diff -u -p -r1.4 perform.c
--- perform.c	20 Apr 2013 15:29:22 -0000	1.4
+++ perform.c	17 May 2015 13:40:03 -0000
@@ -912,7 +912,11 @@ check_platform(struct pkg_task *pkg)
 	if (OverrideMachine != NULL)
 		effective_arch = OverrideMachine;
 	else
+#if defined(MACHINE32_ARCH) && !defined(_LP64)
+		effective_arch = MACHINE32_ARCH;
+#else
 		effective_arch = MACHINE_ARCH;
+#endif
 
 	/* If either the OS or arch are different, bomb */
 	if (strcmp(OPSYS_NAME, pkg->buildinfo[BI_OPSYS]) ||


Home | Main Index | Thread Index | Old Index