Closed Bug 174143 Opened 22 years ago Closed 22 years ago

The PLATFORM environment variable causes compile failure

Categories

(NSS :: Build, defect, P1)

Sun
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: seemant, Assigned: wtc)

Details

Attachments

(1 file)

Hi,  I do not know what causes this error, but on gentoo, when compiling
mozilla: I get this output:

/bin/sh: ../../../coreconf/nsinstall/Linux2.4_sparc_glibc_PTH_OPT.OBJ/nsinstall:
No such file or directory
make[4]: *** [sparc64-unknown-linux-gnu/alg1485.o] Error 127
make[4]: Leaving directory
`/var/tmp/portage/mozilla-1.0.1-r1/work/mozilla/security/nss/lib/certdb'
Sat Oct 12 18:52:09 Local time zone must be set--see zic manual page 2002
cd certhigh; emake -j1 libs
make[4]: Entering directory
`/var/tmp/portage/mozilla-1.0.1-r1/work/mozilla/security/nss/lib/certhigh'
/bin/sh: ../../../coreconf/nsinstall/Linux2.4_sparc_glibc_PTH_OPT.OBJ/nsinstall:
No such file or directory
make[4]: *** [sparc64-unknown-linux-gnu/certhtml.o] Error 127
make[4]: Leaving directory
`/var/tmp/portage/mozilla-1.0.1-r1/work/mozilla/security/nss/lib/certhigh'
Sat Oct 12 18:52:09 Local time zone must be set--see zic manual page 2002
cd pk11wrap; emake -j1 libs
make[4]: Entering directory
`/var/tmp/portage/mozilla-1.0.1-r1/work/mozilla/security/nss/lib/pk11wrap'
/bin/sh: ../../../coreconf/nsinstall/Linux2.4_sparc_glibc_PTH_OPT.OBJ/nsinstall:
No such file or directory
make[4]: *** [sparc64-unknown-linux-gnu/dev3hack.o] Error 127
make[4]: Leaving directory
`/var/tmp/portage/mozilla-1.0.1-r1/work/mozilla/security/nss/lib/pk11wrap'
Sat Oct 12 18:52:10 Local time zone must be set--see zic manual page 2002
cd cryptohi; emake -j1 libs
make[4]: Entering directory
`/var/tmp/portage/mozilla-1.0.1-r1/work/mozilla/security/nss/lib/cryptohi'
/bin/sh: ../../../coreconf/nsinstall/Linux2.4_sparc_glibc_PTH_OPT.OBJ/nsinstall:
No such file or directory


ad nauseum.

Here's the thing, nsinstall is actually in:
../../../coreconf/nsinstall/sparc64-unknown-linux-gnu/nsinstall

How do I tell mozilla this?  Or is this an error on an even more fundamental level?
by the way this happens on 1.0 and 1.0.1, sorry :)

and I did apply a patch that I found in another bug report on here about the
sparc/sparc64 linux platform.  the error persists despite that patch...
==> Build Config
Assignee: asa → seawood
Component: Browser-General → Build Config
QA Contact: asa → granrose
I'm sorry?
coreconf is NSS.
Assignee: seawood → wtc
Component: Build Config → Build
Product: Browser → NSS
QA Contact: granrose → wtc
Version: other → 3.6
Do you have the environment variable PLATFORM set
to sparc64-unknown-linux-gnu when you build Mozilla?
That would explain this build failure.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Version: 3.6 → 3.5
I did that and it didn't work :/
that is to say, it failed compilation with the exact same errors...
Actually, I meant that you should not have PLATFORM
set in your environment.

Could you show me your environment?
construct root # set
BASH=/bin/bash
BASH_VERSINFO=([0]="2" [1]="05a" [2]="0" [3]="1" [4]="release"
[5]="sparc-unknown-linux-gnu")
BASH_VERSION='2.05a.0(1)-release'
COLUMNS=80
CVS_RSH=ssh
DIRSTACK=()
EDITOR=/usr/bin/nano
EUID=0
GROUPS=()
HISTFILE=/root/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/root
HOSTNAME=construct
HOSTTYPE=sparc
IFS=$' \t\n'
INFODIR=/usr/share/info:/usr/X11R6/info
INPUTRC=/etc/inputrc
LESSOPEN='|lesspipe.sh %s'
LINES=24
LOGNAME=root
MACHTYPE=sparc-unknown-linux-gnu
MAIL=/var/mail/root
MAILCHECK=60
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11R6/man
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PAGER=/usr/bin/less
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/bin:/usr/X11R6/bin
PIPESTATUS=([0]="0")
PPID=24744
PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'
PS2='> '
PS4='+ '
PWD=/root
SHELL=/bin/bash
SHELLOPTS=braceexpand:hashall:histexpand:monitor:history:interactive-comments:emacs
SHLVL=1
SSH_CLIENT='10.0.0.2 34737 22'
SSH_TTY=/dev/pty/s1
TERM=rxvt
UID=0
USER=root
VIMRUNTIME=/usr/share/vim/vim61
XINITRC=/etc/X11/xinit/xinitrc
_=INPUTRC
Your environment looks fine.  I have no idea what caused
the build error.  Since I don't have a Gentoo Linux machine,
I won't be able to help much other than pointing you at
things to look at.

The key to debugging this is to find out which environment
or make variable has the value sparc64-unknown-linux-gnu.
Note that nothing in your environment has that value.  The
closest thing in your environment is sparc-unknown-linux-gnu,
which doesn't have '64' after 'sparc'.  Moreover, it's
MACHTYPE that has the value, and our build system does not
check the value of MACHTYPE.

One thing that would have led to this error is that you set
PLATFORM to sparc64-unknown-linux-gnu in your environment.
But you didn't do that.  So I am at a loss as to what's wrong.
ok so it turns out that gentoo's emerge does, indeed, set the PLATFORM
environment variable. The funny thing is that it does this for x86, ppc, and
alpha as well, but only affects sparc64 (sparc as well?)...
ok, it was our fault on gentoo for setting the PLATFORM in the system profile
(it differed from CHOST).

this means mozilla can't be cross-compiled I assume?
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Actually this is a bug in our build system.
Others have run into this problem before,
which is why I asked you if PLATFORM was set
in your environment.

It is easy to fix this bug.  I will attach a
patch.  It is also easy to work around this
bug -- just make sure that PLATFORM is not set
in the environment.
Status: RESOLVED → REOPENED
Priority: -- → P1
Resolution: INVALID → ---
Target Milestone: --- → 3.7
yeah, unsetting the PLATFORM variable was what I wound up doing on the sparc64
profiles in Gentoo, and it worked like a charm...would love to see your patch
though.
Attached patch Proposed patchSplinter Review
This bug was introduced in NSS 3.4 when the definition of
PLATFORM changed from (in platform.mk)

  PLATFORM = $(OBJDIR_NAME)

to (in config.mk)

  ifndef PLATFORM
  PLATFORM = $(OBJDIR_NAME)
  endif

If PLATFORM is already set (for example, as an environment
variable), we won't set PLATFORM to the right value.

This patch does two things.  

1. Do not use the value of PLATFORM from the environment.

2. Remove the obsolete file mozilla/security/coreconf/platform.mk.
Status: REOPENED → ASSIGNED
Summary: Compile failure → The PLATFORM environment variable causes compile failure
Version: 3.5 → 3.4
I checked in the patch.

If it is useful to override PLATFORM in our own makefiles
(such as the manifest.mn file), we should rename the
variable (such as NS_PLATFORM or CORE_PLATFORM) because
PLATFORM is a common environment variable.  (This is at
least the third report of this bug.)

I doubt it will be easy to override PLATFORM though because
our makefiles inadvertently depend on certain relations
between PLATFORM, OBJDIR_NAME, and OBJDIR, so you'd probably
need to override all three.  For the record, the relations
are described below.

coreconf/config.mk (the old version has the two lines
marked with '-'):

-ifndef PLATFORM
 PLATFORM = $(OBJDIR_NAME)
-endif

coreconf/location.mk:

ifdef BUILD_TREE
ifdef LIBRARY_NAME
...
OBJDIR        = $(BUILD_TREE)/nss/$(LIBRARY_NAME)
...
else
...
OBJDIR        = $(BUILD_TREE)/nss
...
endif
else
...
OBJDIR        = $(PLATFORM)
...
endif

coreconf/UNIX.mk:

ifdef BUILD_TREE
NSINSTALL_DIR  = $(BUILD_TREE)/nss
NSINSTALL      = $(BUILD_TREE)/nss/nsinstall
else
NSINSTALL_DIR  = $(CORE_DEPTH)/coreconf/nsinstall
NSINSTALL      = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall
endif

Note that the last two inadvertently imply that
PLATFORM is equal to OBJDIR_NAME if BUILD_TREE is
not defined.  My fix ensures this relation by not
allowing PLATFORM to be overridden in coreconf/config.mk,
but we could also fix this by using $(PLATFORM)
instead of $(OBJDIR_NAME) in the definition of
NSINSTALL in coreconf/UNIX.mk, to be consistent with
the definition of OBJDIR in coreconf/location.mk.
I think the latter is something we should do anyway.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: